Skip to content

Commit

Permalink
Merge pull request godotengine#20440 from Chaosus/fixtexturecrash
Browse files Browse the repository at this point in the history
Fix game crash when you pass invalid or null parameter to ImageTexture.set_data
  • Loading branch information
mhilbrunner authored Jul 25, 2018
2 parents f778bd8 + bde962d commit 46985ae
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scene/resources/texture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ Error ImageTexture::load(const String &p_path) {

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);

_change_notify();
Expand Down

0 comments on commit 46985ae

Please sign in to comment.