commit 09e77b208f8a5245122e537db16007b438ba1403
Author: Alexander Larsson <alexl@redhat.com>
Date:   Mon Apr 4 16:34:06 2011 +0200

    [xrandr] Don't crash in gnome_rr_config_ensure_primary
    
    top_left may be NULL if all outputs are off, which happened to
    me (temporarily) when spice goes into fullscreen mode.

diff --git a/libgnome-desktop/gnome-rr-config.c b/libgnome-desktop/gnome-rr-config.c
index 5eae693..9511034 100644
--- a/libgnome-desktop/gnome-rr-config.c
+++ b/libgnome-desktop/gnome-rr-config.c
@@ -1228,7 +1228,8 @@ gnome_rr_config_ensure_primary (GnomeRRConfig *configuration)
         if (!found) {
                 if (laptop != NULL) {
                         laptop->priv->primary = TRUE;
-                } else {
+                } else if (top_left != NULL) {
+                        /* Note: top_left can be NULL if all outputs are off */
                         top_left->priv->primary = TRUE;
                 }
         }
