summaryrefslogtreecommitdiff
path: root/modules/mono
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-10-13 09:05:22 +0200
committerRémi Verschelde <rverschelde@gmail.com>2022-10-13 09:05:22 +0200
commitb9e924c806870d1c9dc8705d5af9230504e737da (patch)
tree90b507d589a21fd6f1fbc0630f926c9d5b4df804 /modules/mono
parentf2bd389e210a3dd1b8384f42c2ce8c22fa8a88f3 (diff)
parent5f47873f1064defc0f2c3ad7163812a19f58d707 (diff)
Merge pull request #67216 from dotlogix/Bugfix/FixErrorWhenSerializingSignals
Fix crash when serializing empty delegates in C#
Diffstat (limited to 'modules/mono')
-rw-r--r--modules/mono/glue/GodotSharp/GodotSharp/Core/DelegateUtils.cs5
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/DelegateUtils.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/DelegateUtils.cs
index 3c75d18943..9b3969d453 100644
--- a/modules/mono/glue/GodotSharp/GodotSharp/Core/DelegateUtils.cs
+++ b/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;