info: Do not crash if Renderer is not set by SessionManager
authorOndrej Holy <oholy@redhat.com>
Mon, 5 Dec 2016 09:15:12 +0000 (10:15 +0100)
committerAndreas Henriksson <andreas@fatal.se>
Tue, 30 May 2017 20:29:04 +0000 (21:29 +0100)
This regression has been introduced by commit 52da4da. The
info panel crashes if prettify_info() returns NULL. This happens
if Renderer property from SessionManager is empty.

https://bugzilla.gnome.org/show_bug.cgi?id=774240

Gbp-Pq: Name info-Do-not-crash-if-Renderer-is-not-set-by-SessionM.patch

panels/info/info-cleanup.c

index 20243ecfb58e065c0a0984f3d49506489fa3e2ba..bb47493aa817790cbe3f1d82de03c8ee75ed55af 100644 (file)
@@ -99,6 +99,9 @@ remove_duplicate_whitespace (const char *old)
   GRegex *re;
   GError *error;
 
+  if (old == NULL)
+    return NULL;
+
   error = NULL;
   re = g_regex_new ("[ \t\n\r]+", G_REGEX_MULTILINE, 0, &error);
   if (re == NULL)