소스 검색

Merge pull request #78240 from KoBeWi/nothing_valid_here,_keep_scrolling

Safe-guard against missing node arrays
Rémi Verschelde 2 년 전
부모
커밋
41b34e3e56
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 1
      scene/resources/packed_scene.cpp

+ 4 - 1
scene/resources/packed_scene.cpp

@@ -473,7 +473,10 @@ Node *SceneState::instantiate(GenEditState p_edit_state) const {
 			const String base_property = string_property.get_slice("/", 0);
 			const int index = string_property.get_slice("/", 2).to_int();
 
-			Array array = dnp.base->get(base_property);
+			bool valid;
+			Array array = dnp.base->get(base_property, &valid);
+			ERR_CONTINUE(!valid);
+
 			if (array.size() >= index) {
 				array.push_back(other);
 			} else {