printing: Don't crash when printer-state-message not provided

Check whether "printer-state-message" was returned before its
usage.

https://bugzilla.gnome.org/show_bug.cgi?id=699750
This commit is contained in:
Marek Kasik 2013-05-06 13:43:18 +02:00
parent a725b06363
commit bdf40603d5

View File

@ -2320,7 +2320,7 @@ set_info_state_message (PrinterSetupInfo *info)
if (info->reason_level >= GTK_PRINTER_STATE_LEVEL_WARNING)
{
if (strlen (info->state_msg) == 0)
if (info->state_msg == NULL || info->state_msg[0] == '\0')
{
g_free (info->state_msg);
info->state_msg = reason_msg_desc;