summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--modules/mono/glue/GodotSharp/GodotSharp/Core/GodotObject.base.cs5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/GodotObject.base.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/GodotObject.base.cs
index b9a5ac82d1..12e8a638d3 100644
--- a/modules/mono/glue/GodotSharp/GodotSharp/Core/GodotObject.base.cs
+++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/GodotObject.base.cs
@@ -125,7 +125,10 @@ namespace Godot
NativePtr = IntPtr.Zero;
}
- DisposablesTracker.UnregisterGodotObject(this, _weakReferenceToSelf);
+ if (_weakReferenceToSelf != null)
+ {
+ DisposablesTracker.UnregisterGodotObject(this, _weakReferenceToSelf);
+ }
}
/// <summary>