Index: gobject/gtype.c
===================================================================
--- gobject/gtype.c	(revision 5659)
+++ gobject/gtype.c	(working copy)
@@ -158,6 +158,7 @@
                                                                          TypeNode               *node);
 static gboolean				type_node_is_a_L		(TypeNode		*node,
 									 TypeNode		*iface_node);
+static inline char* 			_get_non_null_node_name		(TypeNode *node);
 
 
 /* --- enumeration --- */
@@ -205,7 +206,7 @@
 #define NODE_TYPE(node)				(node->supers[0])
 #define NODE_PARENT_TYPE(node)			(node->supers[1])
 #define NODE_FUNDAMENTAL_TYPE(node)		(node->supers[node->n_supers])
-#define NODE_NAME(node)				(g_quark_to_string (node->qname))
+#define NODE_NAME(node)				(_get_non_null_node_name(node))
 #define	NODE_IS_IFACE(node)			(NODE_FUNDAMENTAL_TYPE (node) == G_TYPE_INTERFACE)
 #define	CLASSED_NODE_N_IFACES(node)		((node)->_prot_n_ifaces_prerequisites)
 #define	CLASSED_NODE_IFACES_ENTRIES(node)	((node)->_prot.iface_entries)
@@ -312,6 +313,12 @@
 static TypeNode		*static_fundamental_type_nodes[(G_TYPE_FUNDAMENTAL_MAX >> G_TYPE_FUNDAMENTAL_SHIFT) + 1] = { NULL, };
 static GType		 static_fundamental_next = G_TYPE_RESERVED_USER_FIRST;
 
+static inline char*
+_get_non_null_node_name (TypeNode *node) {
+	char *name = g_quark_to_string(node->qname);
+	return name ? name : "(null)";
+}
+
 static inline TypeNode*
 lookup_type_node_I (register GType utype)
 {
