Merge pull request #78240 from KoBeWi/nothing_valid_here,_keep_scrolling

Safe-guard against missing node arrays
This commit is contained in:
Rémi Verschelde 2023-06-15 10:50:45 +02:00
commit 41b34e3e56
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -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 {