[evolution] Do not crash in create_default_shell()



commit f12ec068f993121f8dc8a3170591d21be6a2a665
Author: Milan Crha <mcrha redhat com>
Date:   Wed Oct 17 14:10:40 2012 +0200

    Do not crash in create_default_shell()

 shell/main.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/shell/main.c b/shell/main.c
index c7172be..d71e499 100644
--- a/shell/main.c
+++ b/shell/main.c
@@ -421,10 +421,14 @@ create_default_shell (void)
 		NULL);
 
 	/* Failure to register is fatal. */
-	if (error != NULL)
-		g_error ("%s", error->message);
+	if (error != NULL) {
+		e_notice (NULL, GTK_MESSAGE_ERROR,
+			_("Cannot start Evolution, other instance is probably running and is unresponsive. System error: %s"),
+			error->message);
+		g_clear_error (&error);
+	}
 
-	if (force_online)
+	if (force_online && shell)
 		e_shell_lock_network_available (shell);
 
 	g_object_unref (settings);
@@ -657,6 +661,8 @@ main (gint argc,
 		e_ensure_type (WEBKIT_TYPE_WEB_VIEW);
 
 	shell = create_default_shell ();
+	if (!shell)
+		return 1;
 
 	if (quit) {
 		e_shell_quit (shell, E_SHELL_QUIT_OPTION);



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