diff options
| author | endlesstravel <yx33355555@163.com> | 2020-07-03 09:52:40 +0800 |
|---|---|---|
| committer | endlesstravel <yx33355555@163.com> | 2020-07-03 16:55:09 +0800 |
| commit | d2461bad637c65fa41150725eeae4bb197662ea3 (patch) | |
| tree | 78710354d7515deafddb0cf936116a106f603a14 /modules/mono/mono_gd | |
| parent | 67e4082b1e73f3cbe518c499eb328b0f68f3419b (diff) | |
| download | redot-engine-d2461bad637c65fa41150725eeae4bb197662ea3.tar.gz | |
fix crash when pass null in print array in GD.print
fix crash when pass null in print array in GD.print 2
fix crash when pass null in print array in GD.print 3
fix space
Diffstat (limited to 'modules/mono/mono_gd')
| -rw-r--r-- | modules/mono/mono_gd/gd_mono_marshal.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/mono/mono_gd/gd_mono_marshal.cpp b/modules/mono/mono_gd/gd_mono_marshal.cpp index 158742846b..92734a0792 100644 --- a/modules/mono/mono_gd/gd_mono_marshal.cpp +++ b/modules/mono/mono_gd/gd_mono_marshal.cpp @@ -1035,6 +1035,10 @@ Variant mono_object_to_variant_no_err(MonoObject *p_obj, const ManagedType &p_ty } String mono_object_to_variant_string(MonoObject *p_obj, MonoException **r_exc) { + if (p_obj == nullptr) { + return String("null"); + } + ManagedType type = ManagedType::from_class(mono_object_get_class(p_obj)); Variant var = GDMonoMarshal::mono_object_to_variant_no_err(p_obj, type); |
