Improve handling of case where constructing struct with 0 size
authorRobert Carr <racarr@gnome.org>
Thu, 17 Dec 2009 22:32:36 +0000 (17:32 -0500)
committerRobert Carr <racarr@gnome.org>
Thu, 17 Dec 2009 22:32:36 +0000 (17:32 -0500)
libseed/seed-structs.c

index 42b5d52..1c58e0a 100644 (file)
@@ -690,7 +690,12 @@ seed_construct_struct_type_with_parameters (JSContextRef ctx,
     {
       size = g_union_info_get_size ((GIUnionInfo *) info);
     }
-  g_assert (size);
+  if (!size)
+    {
+      g_critical ("Struct/union of type: %s has size 0 in introspection data. Please check GIR",
+                 g_base_info_get_name (info));
+      g_assert(size);
+    }
   object = g_slice_alloc0 (size);
 
   SEED_NOTE (CONSTRUCTION,