[evince] shell: Don't crash when we don't have a DBUS connection



commit ba540cc933501c25ee8caddc9225b782e0fec8ae
Author: Christian Persch <chpe gnome org>
Date:   Tue Oct 20 20:01:12 2009 +0200

    shell: Don't crash when we don't have a DBUS connection
    
    When getting the DBUS fails, we don't create the applications->windows
    hash table, but were still looking things up in it.

 shell/ev-application.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/shell/ev-application.c b/shell/ev-application.c
index 69a5a73..24ef1e0 100644
--- a/shell/ev-application.c
+++ b/shell/ev-application.c
@@ -667,7 +667,8 @@ ev_application_open_uri_in_window (EvApplication  *application,
 	ev_window_open_uri (ev_window, uri, dest, mode, search_string);
 
 #ifdef ENABLE_DBUS
-	if (!g_hash_table_lookup (application->windows, ev_window)) {
+	if (application->windows != NULL &&
+            !g_hash_table_lookup (application->windows, ev_window)) {
 		g_hash_table_insert (application->windows, ev_window, g_strdup (uri));
 		g_signal_connect_swapped (ev_window, "destroy",
 					  G_CALLBACK (ev_application_window_destroyed),



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]