diff --git a/editor/plugins/packed_scene_translation_parser_plugin.cpp b/editor/plugins/packed_scene_translation_parser_plugin.cpp index b38965753e8..c6c75505395 100644 --- a/editor/plugins/packed_scene_translation_parser_plugin.cpp +++ b/editor/plugins/packed_scene_translation_parser_plugin.cpp @@ -32,7 +32,6 @@ #include "core/io/resource_loader.h" #include "core/object/script_language.h" -#include "scene/gui/option_button.h" #include "scene/resources/packed_scene.h" void PackedSceneEditorTranslationParserPlugin::get_recognized_extensions(List *r_extensions) const { @@ -49,7 +48,9 @@ Error PackedSceneEditorTranslationParserPlugin::parse_file(const String &p_path, ERR_PRINT("Failed to load " + p_path); return err; } - Ref state = Ref(loaded_res)->get_state(); + Ref packed_scene = loaded_res; + ERR_FAIL_COND_V_MSG(packed_scene.is_null(), ERR_FILE_UNRECOGNIZED, p_path.quote() + " is not a valid PackedScene resource."); + Ref state = packed_scene->get_state(); Vector parsed_strings; Vector> atr_owners;