--- registryd/registry-main.c.orig	2008-11-17 06:45:38.000000000 +0100
+++ registryd/registry-main.c	2008-11-17 06:45:02.000000000 +0100
@@ -52,17 +52,25 @@
 
   obj_id = "OAFIID:Accessibility_Registry:1.0";
 
-  registry = spi_registry_new ();
-
   display_name = g_getenv ("AT_SPI_DISPLAY");
   if (!display_name)
   {
       display_name = g_getenv ("DISPLAY");
+      if (!display_name) {
+#ifdef AT_SPI_DEBUG
+        fprintf (stderr, "SpiRegistry Message: SpiRegistry needs DISPLAY or AT_SPI_DISPLAY (both NULL).\n");
+#endif
+        /* bail out */
+        return 1;
+      }
+
       cp = strrchr (display_name, '.');
       dp = strrchr (display_name, ':');
       if (cp && dp && (cp > dp)) *cp = '\0';
   }
 
+  registry = spi_registry_new ();
+
   ret = bonobo_activation_register_active_server (
 	  obj_id,
 	  bonobo_object_corba_objref (bonobo_object (registry)),
