Browse Source

Merge pull request #57727 from kleonc/sprite_frames_editor_fix_loading_non_texture_crash

`SpriteFramesEditor` Fix crash when selecting non-`Texture2D` file for splitting
Rémi Verschelde 3 years ago
parent
commit
602cacae21
1 changed files with 1 additions and 1 deletions
  1. 1 1
      editor/plugins/sprite_frames_editor_plugin.cpp

+ 1 - 1
editor/plugins/sprite_frames_editor_plugin.cpp

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