Don't crash on previewing an AtlasTexture without a region
This commit is contained in:
parent
270bbee018
commit
464e1142c4
2 changed files with 8 additions and 0 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue