diff --git a/Source/Libs/GLibSharp/ToggleRef.cs b/Source/Libs/GLibSharp/ToggleRef.cs index 73c6363ad..b31ddd7e3 100644 --- a/Source/Libs/GLibSharp/ToggleRef.cs +++ b/Source/Libs/GLibSharp/ToggleRef.cs @@ -112,7 +112,7 @@ namespace GLib { try { GCHandle gch = (GCHandle) data; ToggleRef tref = (ToggleRef)gch.Target; - tref.Toggle (is_last_ref); + tref?.Toggle (is_last_ref); } catch (Exception e) { ExceptionManager.RaiseUnhandledException (e, false); }