[evince] shell: Fix a crash when failed to connect to D-BUS daemon



commit 08dbb3dc25f761ab7f1f2ca905842823c90feed3
Author: Brennan Shacklett <bpshacklett gmail com>
Date:   Sat Feb 2 15:53:42 2013 +0100

    shell: Fix a crash when failed to connect to D-BUS daemon
    
    The patch checks for a null pointer in the code that was causing the
    segfault and instead of just returning from the dbus enabled open uri
    code falls back to the function that opens documents with dbus support
    when the program doesn't have a connection to dbus.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=691672

 shell/ev-application.c |    5 ++++-
 shell/ev-window.c      |    3 ++-
 2 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/shell/ev-application.c b/shell/ev-application.c
index 0272477..7254cda 100644
--- a/shell/ev-application.c
+++ b/shell/ev-application.c
@@ -528,8 +528,11 @@ ev_application_register_uri (EvApplication  *application,
 {
 	EvRegisterDocData *data;
 
-	if (!application->skeleton)
+	/* If connection hasn't been made fall back to opening without D-BUS features */
+	if (!application->skeleton) {
+		_ev_application_open_uri_at_dest (application, uri, screen, dest, mode, search_string, timestamp);
 		return;
+	}
 
 	if (application->doc_registered) {
 		/* Already registered, reload */
diff --git a/shell/ev-window.c b/shell/ev-window.c
index 603b681..97f4a90 100644
--- a/shell/ev-window.c
+++ b/shell/ev-window.c
@@ -6179,7 +6179,8 @@ view_actions_focus_in_cb (GtkWidget *widget, GdkEventFocus *event, EvWindow *win
 	GObject *keys;
 
 	keys = ev_application_get_media_keys (EV_APP);
-	ev_media_player_keys_focused (EV_MEDIA_PLAYER_KEYS (keys));
+	if (keys)
+		ev_media_player_keys_focused (EV_MEDIA_PLAYER_KEYS (keys));
 #endif /* ENABLE_DBUS */
 
 	update_chrome_flag (window, EV_CHROME_RAISE_TOOLBAR, FALSE);



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