[gnome-software/gnome-3-14] Don't crash when PackageKit returns NULL description



commit e349badd89c811c2087415c11f7be76eecaa9052
Author: Kalev Lember <kalevlember gmail com>
Date:   Wed Jun 3 16:34:21 2015 +0200

    Don't crash when PackageKit returns NULL description
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1226426

 src/plugins/gs-plugin-packagekit-refresh.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/src/plugins/gs-plugin-packagekit-refresh.c b/src/plugins/gs-plugin-packagekit-refresh.c
index 0a71eed..c8c181e 100644
--- a/src/plugins/gs-plugin-packagekit-refresh.c
+++ b/src/plugins/gs-plugin-packagekit-refresh.c
@@ -175,6 +175,9 @@ gs_plugin_packagekit_refresh_set_text (GsApp *app, const gchar *text)
        gchar *nl;
        gchar *tmp;
 
+       if (text == NULL || text[0] == '\0')
+               return;
+
        /* look for newline */
        tmp = g_strdup (text);
        nl = g_strstr_len (tmp, -1, "\n");


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