Merge pull request #89 from knocte/master

glib: fix IntPtr.Zero being dereferenced in GLib.Value.ToBoxed()
This commit is contained in:
Bertrand Lorentz 2013-11-09 08:08:40 -08:00
commit 859832f6e4

View file

@ -414,6 +414,10 @@ namespace GLib {
object ToBoxed () object ToBoxed ()
{ {
IntPtr boxed_ptr = g_value_get_boxed (ref this); IntPtr boxed_ptr = g_value_get_boxed (ref this);
if (boxed_ptr == IntPtr.Zero)
return null;
Type t = GType.LookupType (type); Type t = GType.LookupType (type);
if (t == null) if (t == null)
throw new Exception ("Unknown type " + new GType (type).ToString ()); throw new Exception ("Unknown type " + new GType (type).ToString ());