SpriteFramesEditor Fix crash when selecting non-Texture2D file for splitting

This commit is contained in:
kleonc 2022-02-06 23:39:04 +01:00
parent 3ae38edc8e
commit 803ac608a6

View File

@ -285,7 +285,7 @@ void SpriteFramesEditor::_sheet_spin_changed(double) {
}
void SpriteFramesEditor::_prepare_sprite_sheet(const String &p_file) {
Ref<Resource> texture = ResourceLoader::load(p_file);
Ref<Texture2D> texture = ResourceLoader::load(p_file);
if (!texture.is_valid()) {
EditorNode::get_singleton()->show_warning(TTR("Unable to load images"));
ERR_FAIL_COND(!texture.is_valid());