@@ -612,27 +612,29 @@ Error ResourceLoaderText::load() {
612612 }
613613 }
614614
615- if (value.get_type () == Variant::ARRAY) {
616- Array set_array = value;
617- bool is_get_valid = false ;
618- Variant get_value = res->get (assign, &is_get_valid);
619- if (is_get_valid && get_value.get_type () == Variant::ARRAY) {
620- Array get_array = get_value;
621- if (!set_array.is_same_typed (get_array)) {
622- value = Array (set_array, get_array.get_typed_builtin (), get_array.get_typed_class_name (), get_array.get_typed_script ());
615+ if (ClassDB::has_property (res->get_class_name (), assign)) {
616+ if (value.get_type () == Variant::ARRAY) {
617+ Array set_array = value;
618+ bool is_get_valid = false ;
619+ Variant get_value = res->get (assign, &is_get_valid);
620+ if (is_get_valid && get_value.get_type () == Variant::ARRAY) {
621+ Array get_array = get_value;
622+ if (!set_array.is_same_typed (get_array)) {
623+ value = Array (set_array, get_array.get_typed_builtin (), get_array.get_typed_class_name (), get_array.get_typed_script ());
624+ }
623625 }
624626 }
625- }
626627
627- if (value.get_type () == Variant::DICTIONARY) {
628- Dictionary set_dict = value;
629- bool is_get_valid = false ;
630- Variant get_value = res->get (assign, &is_get_valid);
631- if (is_get_valid && get_value.get_type () == Variant::DICTIONARY) {
632- Dictionary get_dict = get_value;
633- if (!set_dict.is_same_typed (get_dict)) {
634- value = Dictionary (set_dict, get_dict.get_typed_key_builtin (), get_dict.get_typed_key_class_name (), get_dict.get_typed_key_script (),
635- get_dict.get_typed_value_builtin (), get_dict.get_typed_value_class_name (), get_dict.get_typed_value_script ());
628+ if (value.get_type () == Variant::DICTIONARY) {
629+ Dictionary set_dict = value;
630+ bool is_get_valid = false ;
631+ Variant get_value = res->get (assign, &is_get_valid);
632+ if (is_get_valid && get_value.get_type () == Variant::DICTIONARY) {
633+ Dictionary get_dict = get_value;
634+ if (!set_dict.is_same_typed (get_dict)) {
635+ value = Dictionary (set_dict, get_dict.get_typed_key_builtin (), get_dict.get_typed_key_class_name (), get_dict.get_typed_key_script (),
636+ get_dict.get_typed_value_builtin (), get_dict.get_typed_value_class_name (), get_dict.get_typed_value_script ());
637+ }
636638 }
637639 }
638640 }
@@ -752,27 +754,29 @@ Error ResourceLoaderText::load() {
752754 }
753755 }
754756
755- if (value.get_type () == Variant::ARRAY) {
756- Array set_array = value;
757- bool is_get_valid = false ;
758- Variant get_value = resource->get (assign, &is_get_valid);
759- if (is_get_valid && get_value.get_type () == Variant::ARRAY) {
760- Array get_array = get_value;
761- if (!set_array.is_same_typed (get_array)) {
762- value = Array (set_array, get_array.get_typed_builtin (), get_array.get_typed_class_name (), get_array.get_typed_script ());
757+ if (ClassDB::has_property (resource->get_class_name (), assign)) {
758+ if (value.get_type () == Variant::ARRAY) {
759+ Array set_array = value;
760+ bool is_get_valid = false ;
761+ Variant get_value = resource->get (assign, &is_get_valid);
762+ if (is_get_valid && get_value.get_type () == Variant::ARRAY) {
763+ Array get_array = get_value;
764+ if (!set_array.is_same_typed (get_array)) {
765+ value = Array (set_array, get_array.get_typed_builtin (), get_array.get_typed_class_name (), get_array.get_typed_script ());
766+ }
763767 }
764768 }
765- }
766769
767- if (value.get_type () == Variant::DICTIONARY) {
768- Dictionary set_dict = value;
769- bool is_get_valid = false ;
770- Variant get_value = resource->get (assign, &is_get_valid);
771- if (is_get_valid && get_value.get_type () == Variant::DICTIONARY) {
772- Dictionary get_dict = get_value;
773- if (!set_dict.is_same_typed (get_dict)) {
774- value = Dictionary (set_dict, get_dict.get_typed_key_builtin (), get_dict.get_typed_key_class_name (), get_dict.get_typed_key_script (),
775- get_dict.get_typed_value_builtin (), get_dict.get_typed_value_class_name (), get_dict.get_typed_value_script ());
770+ if (value.get_type () == Variant::DICTIONARY) {
771+ Dictionary set_dict = value;
772+ bool is_get_valid = false ;
773+ Variant get_value = resource->get (assign, &is_get_valid);
774+ if (is_get_valid && get_value.get_type () == Variant::DICTIONARY) {
775+ Dictionary get_dict = get_value;
776+ if (!set_dict.is_same_typed (get_dict)) {
777+ value = Dictionary (set_dict, get_dict.get_typed_key_builtin (), get_dict.get_typed_key_class_name (), get_dict.get_typed_key_script (),
778+ get_dict.get_typed_value_builtin (), get_dict.get_typed_value_class_name (), get_dict.get_typed_value_script ());
779+ }
776780 }
777781 }
778782 }
0 commit comments