Index: glib/gobject/gtype.c
===================================================================
--- glib.orig/gobject/gtype.c
+++ glib/gobject/gtype.c
@@ -2741,7 +2741,7 @@ g_type_class_peek (GType type)
   
   node = lookup_type_node_I (type);
   G_READ_LOCK (&type_rw_lock);
-  if (node && node->is_classed && node->data && node->data->class.class) /* common.ref_count _may_ be 0 */
+  if (node && node->is_classed && node->data && node->data->class.init_state == INITIALIZED) /* common.ref_count _may_ be 0 */
     class = node->data->class.class;
   else
     class = NULL;
@@ -2771,7 +2771,7 @@ g_type_class_peek_static (GType type)
   G_READ_LOCK (&type_rw_lock);
   if (node && node->is_classed && node->data &&
       /* peek only static types: */ node->plugin == NULL &&
-      node->data->class.class) /* common.ref_count _may_ be 0 */
+      node->data->class.init_state == INITIALIZED) /* common.ref_count _may_ be 0 */
     class = node->data->class.class;
   else
     class = NULL;
