Merge pull request #43610 from RandomShaper/fix_res_duplicate
Fix crash in resoure duplicate
This commit is contained in:
commit
386ee52978
@ -209,8 +209,8 @@ Ref<Resource> Resource::duplicate(bool p_subresources) const {
|
|||||||
List<PropertyInfo> plist;
|
List<PropertyInfo> plist;
|
||||||
get_property_list(&plist);
|
get_property_list(&plist);
|
||||||
|
|
||||||
Resource *r = (Resource *)ClassDB::instance(get_class());
|
Ref<Resource> r = (Resource *)ClassDB::instance(get_class());
|
||||||
ERR_FAIL_COND_V(!r, Ref<Resource>());
|
ERR_FAIL_COND_V(r.is_null(), Ref<Resource>());
|
||||||
|
|
||||||
for (List<PropertyInfo>::Element *E = plist.front(); E; E = E->next()) {
|
for (List<PropertyInfo>::Element *E = plist.front(); E; E = E->next()) {
|
||||||
if (!(E->get().usage & PROPERTY_USAGE_STORAGE)) {
|
if (!(E->get().usage & PROPERTY_USAGE_STORAGE)) {
|
||||||
@ -230,7 +230,7 @@ Ref<Resource> Resource::duplicate(bool p_subresources) const {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return Ref<Resource>(r);
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Resource::_set_path(const String &p_path) {
|
void Resource::_set_path(const String &p_path) {
|
||||||
|
Loading…
Reference in New Issue
Block a user