diff --git a/daemon/gdm-server.c b/daemon/gdm-server.c
index 8a80c84..3ba90b8 100644
--- a/daemon/gdm-server.c
+++ b/daemon/gdm-server.c
@@ -272,6 +272,11 @@ gdm_server_resolve_command_line (GdmServer  *server,
         gboolean gotvtarg = FALSE;
         gboolean query_in_arglist = FALSE;
 
+        if (!server->priv->command) {
+                g_warning ("X11 server command line is missing");
+                return FALSE;
+        }
+
         g_shell_parse_argv (server->priv->command, &argc, &argv, NULL);
 
         for (len = 0; argv != NULL && argv[len] != NULL; len++) {
@@ -619,10 +624,13 @@ gdm_server_spawn (GdmServer  *server,
         /* Figure out the server command */
         argv = NULL;
         argc = 0;
-        gdm_server_resolve_command_line (server,
-                                         vtarg,
-                                         &argc,
-                                         &argv);
+        if (! gdm_server_resolve_command_line (server,
+                                               vtarg,
+                                               &argc,
+                                               &argv)) {
+                g_warning ("unable to process X11 server command line");
+                return FALSE;
+        }
 
         if (server->priv->session_args) {
                 server_add_xserver_args (server, &argc, &argv);
