5c404ef
From d14700853b39685e5171b5aa99142106cd658aad Mon Sep 17 00:00:00 2001
5c404ef
From: David Tardon <dtardon@redhat.com>
5c404ef
Date: Tue, 24 May 2011 06:30:46 +0200
5c404ef
Subject: [PATCH] handle NULL display gracefully
5c404ef
5c404ef
---
5c404ef
 desktop/unx/source/splashx.c |    6 +++++-
5c404ef
 1 files changed, 5 insertions(+), 1 deletions(-)
5c404ef
5c404ef
diff --git a/desktop/unx/source/splashx.c b/desktop/unx/source/splashx.c
5c404ef
index a8a87b0..dc88343 100755
5c404ef
--- a/desktop/unx/source/splashx.c
5c404ef
+++ b/desktop/unx/source/splashx.c
5c404ef
@@ -574,6 +574,9 @@ static void process_events()
5c404ef
 // Draw the progress
5c404ef
 void splash_draw_progress( int progress )
5c404ef
 {
5c404ef
+    if (!display)
5c404ef
+        return;
5c404ef
+
5c404ef
     // sanity
5c404ef
     if ( progress < 0 )
5c404ef
         progress = 0;
5c404ef
@@ -604,7 +607,8 @@ void splash_draw_progress( int progress )
5c404ef
 // Close the window & cleanup
5c404ef
 void splash_close_window()
5c404ef
 {
5c404ef
-    XCloseDisplay( display );
5c404ef
+    if (display)
5c404ef
+        XCloseDisplay( display );
5c404ef
 #ifdef USE_LIBPNG
5c404ef
     png_destroy_read_struct( &png_ptr, &info_ptr, NULL );
5c404ef
 #else
5c404ef
-- 
5c404ef
1.7.5.1
5c404ef