Allow null struct return values
authorRyan Brown <r@nodr.org>
Mon, 11 Jan 2010 03:46:09 +0000 (21:46 -0600)
committerTim Horton <hortont424@gmail.com>
Mon, 11 Jan 2010 22:15:47 +0000 (17:15 -0500)
libseed/seed-structs.c

index f9ea40c..73d0e48 100644 (file)
@@ -627,6 +627,12 @@ JSObjectRef
 seed_make_struct (JSContextRef ctx, gpointer strukt, GIBaseInfo * info)
 {
   JSObjectRef object, proto;
+
+  if (strukt == NULL)
+    {
+      return JSValueMakeNull (ctx);
+    }
+
   seed_struct_privates *priv = g_slice_alloc (sizeof (seed_struct_privates));
 
   priv->info = info ? g_base_info_ref (info) : 0;