Fix crash when you pass invalid parameter to ImageTexture.set_data

This commit is contained in:
Chaosus 2018-07-25 12:23:34 +03:00
parent f8e8ac2c66
commit bde962dbdd
1 changed files with 2 additions and 0 deletions

View File

@ -235,6 +235,8 @@ Error ImageTexture::load(const String &p_path) {
void ImageTexture::set_data(const Ref<Image> &p_image) { void ImageTexture::set_data(const Ref<Image> &p_image) {
ERR_FAIL_COND(p_image.is_null());
VisualServer::get_singleton()->texture_set_data(texture, p_image); VisualServer::get_singleton()->texture_set_data(texture, p_image);
_change_notify(); _change_notify();