You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
Don't crash on previewing an AtlasTexture without a region
This commit is contained in:
@@ -92,7 +92,12 @@ Ref<Texture> EditorTexturePreviewPlugin::generate(const RES &p_from, const Size2
|
||||
if (!tex.is_valid()) {
|
||||
return Ref<Texture>();
|
||||
}
|
||||
|
||||
Ref<Image> atlas = tex->get_data();
|
||||
if (!atlas.is_valid()) {
|
||||
return Ref<Texture>();
|
||||
}
|
||||
|
||||
img = atlas->get_rect(atex->get_region());
|
||||
} else if (ltex.is_valid()) {
|
||||
img = ltex->to_image();
|
||||
|
||||
Reference in New Issue
Block a user