diff --git a/glib/gerror.c b/glib/gerror.c
index 090632f..fc370c5 100644
--- a/glib/gerror.c
+++ b/glib/gerror.c
@@ -198,6 +198,9 @@ g_set_error (GError      **err,
   
   va_list args;
 
+  g_return_if_fail (format != NULL);
+  g_return_if_fail (domain != 0);
+
   if (err == NULL)
     return;
   
