From 69ea13385598e66aa9230cc92ba2b1a609fd07e8 Mon Sep 17 00:00:00 2001 From: Stephan Sundermann Date: Sun, 21 Sep 2014 14:29:53 +0200 Subject: [PATCH] glib: In Value.Update, check if val is null before updating Signed-off-by: Bertrand Lorentz --- glib/Value.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glib/Value.cs b/glib/Value.cs index be45c5ca5..d6bc71e28 100644 --- a/glib/Value.cs +++ b/glib/Value.cs @@ -573,7 +573,7 @@ namespace GLib { internal void Update (object val) { - if (GType.Is (type, GType.Boxed) && !(val is IWrapper)) { + if (GType.Is (type, GType.Boxed) && val != null && !(val is IWrapper)) { MethodInfo mi = val.GetType ().GetMethod ("Update", BindingFlags.NonPublic | BindingFlags.Instance); IntPtr boxed_ptr = g_value_get_boxed (ref this);