2
0
Эх сурвалжийг харах

Merge pull request #67216 from dotlogix/Bugfix/FixErrorWhenSerializingSignals

Fix crash when serializing empty delegates in C#
Rémi Verschelde 2 жил өмнө
parent
commit
b9e924c806

+ 5 - 0
modules/mono/glue/GodotSharp/GodotSharp/Core/DelegateUtils.cs

@@ -76,6 +76,11 @@ namespace Godot
 
         internal static bool TrySerializeDelegate(Delegate @delegate, Collections.Array serializedData)
         {
+            if (@delegate is null)
+            {
+                return false;
+            }
+
             if (@delegate is MulticastDelegate multicastDelegate)
             {
                 bool someDelegatesSerialized = false;