glib: In Value.Update, check if val is null before updating

Signed-off-by: Bertrand Lorentz <bertrand.lorentz@gmail.com>
This commit is contained in:
Stephan Sundermann 2014-09-21 14:29:53 +02:00 committed by Bertrand Lorentz
parent 324fc7b0e3
commit 69ea133855

View file

@ -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);