summaryrefslogtreecommitdiff
path: root/modules/mono
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-03-07 22:54:03 +0100
committerGitHub <noreply@github.com>2019-03-07 22:54:03 +0100
commit6ee30022370202c08a7743d6efb8ca010786cc4f (patch)
treef853de3c975a1a09aa269e49f8de96f50c5f5d46 /modules/mono
parentbce56cf33797391df02453db90438f5b03e3d39b (diff)
parentc5f8b0960a9384b63d11c8dc99c2a0d6e299c041 (diff)
Merge pull request #26773 from neikeq/issue-26628
Mono: Fix crash with exported field of custom Reference derived type
Diffstat (limited to 'modules/mono')
-rw-r--r--modules/mono/csharp_script.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp
index 86f2562f6d..71c21e0aa1 100644
--- a/modules/mono/csharp_script.cpp
+++ b/modules/mono/csharp_script.cpp
@@ -2249,8 +2249,11 @@ bool CSharpScript::_get_member_export(GDMonoClass *p_class, IMonoClassMember *p_
hint_string = name_only_hint_string;
}
} else if (variant_type == Variant::OBJECT && CACHED_CLASS(GodotReference)->is_assignable_from(type.type_class)) {
+ GDMonoClass *field_native_class = GDMonoUtils::get_class_native_base(type.type_class);
+ CRASH_COND(field_native_class == NULL);
+
hint = PROPERTY_HINT_RESOURCE_TYPE;
- hint_string = NATIVE_GDMONOCLASS_NAME(type.type_class);
+ hint_string = NATIVE_GDMONOCLASS_NAME(field_native_class);
} else {
hint = PropertyHint(CACHED_FIELD(ExportAttribute, hint)->get_int_value(attr));
hint_string = CACHED_FIELD(ExportAttribute, hintString)->get_string_value(attr);