mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-12-23 15:15:34 +00:00
Merge pull request #89 from knocte/master
glib: fix IntPtr.Zero being dereferenced in GLib.Value.ToBoxed()
This commit is contained in:
commit
859832f6e4
|
@ -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 ());
|
||||||
|
|
Loading…
Reference in a new issue