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
This commit is contained in:
Florian Müllner 2012-10-26 18:52:07 +02:00
parent 62ca4ba624
commit acffd1e792

View File

@ -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);
}