diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp index b69c429196a..fd04219d35e 100644 --- a/scene/resources/texture.cpp +++ b/scene/resources/texture.cpp @@ -230,6 +230,8 @@ void ImageTexture::load(const String &p_path) { void ImageTexture::set_data(const Ref &p_image) { + ERR_FAIL_COND(p_image.is_null()); + VisualServer::get_singleton()->texture_set_data(texture, p_image); _change_notify();