--- a/girepository/gibaseinfo.c
+++ b/girepository/gibaseinfo.c
@@ -375,6 +375,7 @@ g_base_info_get_name (GIBaseInfo *info)
       }
       break;
     case GI_INFO_TYPE_TYPE:
+      return NULL;
     default: ;
       g_assert_not_reached ();
       /* unnamed */
