[gnome-shell] main: Guard against NULL log_domain in default handler



commit acffd1e792452ff31fa48cda960555c01d9c9315
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Oct 26 18:52:07 2012 +0200

    main: Guard against NULL log_domain in default handler
    
    g_str_has_prefix() will assert when passed NULL, so we need to make
    sure that we are passed a non-NULL log_domain first.
    
    Spotted by <goughost<at>yahoo.com.cn>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=663601

 src/main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/main.c b/src/main.c
index 8e805a6..ca2116a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -284,7 +284,7 @@ default_log_handler (const char     *log_domain,
 
   /* Filter out telepathy-glib logs, we don't want to flood Shell's output
    * with those. */
-  if (!g_str_has_prefix (log_domain, "tp-glib"))
+  if (!log_domain || !g_str_has_prefix (log_domain, "tp-glib"))
     g_log_default_handler (log_domain, log_level, message, data);
 }
 


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