summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaoyu Qiu <timothyqiu32@gmail.com>2019-12-11 11:24:42 +0800
committerHaoyu Qiu <timothyqiu32@gmail.com>2019-12-11 11:24:42 +0800
commit5586103a9475893bb1a2bcb4ebf7f5005544253f (patch)
tree32a39b1992cb0cc6bba4b45cdd98ec406ba1a8ac
parent435cced7d8fbc80e6842d7c171a87d4db1e64fe4 (diff)
Validates texture in set_piece_texture
-rw-r--r--scene/resources/texture.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp
index 593c399f62..b21546af2f 100644
--- a/scene/resources/texture.cpp
+++ b/scene/resources/texture.cpp
@@ -1333,6 +1333,7 @@ void LargeTexture::set_piece_offset(int p_idx, const Point2 &p_offset) {
void LargeTexture::set_piece_texture(int p_idx, const Ref<Texture> &p_texture) {
ERR_FAIL_COND(p_texture == this);
+ ERR_FAIL_COND(p_texture.is_null());
ERR_FAIL_INDEX(p_idx, pieces.size());
pieces.write[p_idx].texture = p_texture;
};