Pārlūkot izejas kodu

Fix crash assigning script to a Resource

We were dereferencing the wrong identifier, which could be NULL.
Fixes #19289, supersedes and closes #20985.
Rémi Verschelde 7 gadi atpakaļ
vecāks
revīzija
ba47f15b78
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      editor/editor_properties.cpp

+ 1 - 1
editor/editor_properties.cpp

@@ -2052,7 +2052,7 @@ void EditorPropertyResource::_menu_option(int p_which) {
 			ERR_BREAK(!resp);
 			if (get_edited_object() && base_type != String() && base_type == "Script") {
 				//make visual script the right type
-				res->call("set_instance_base_type", get_edited_object()->get_class());
+				resp->call("set_instance_base_type", get_edited_object()->get_class());
 			}
 
 			res = Ref<Resource>(resp);