[gnome-software] trivial: Protect against a critical warning when an app has no ID



commit 2c548f7c9a82647b2d1dacd8dae93d39c0c5dac6
Author: Richard Hughes <richard hughsie com>
Date:   Fri Feb 26 10:18:06 2016 +0000

    trivial: Protect against a critical warning when an app has no ID

 src/gs-app.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-app.c b/src/gs-app.c
index 0ef48e9..700686a 100644
--- a/src/gs-app.c
+++ b/src/gs-app.c
@@ -362,6 +362,8 @@ gs_app_get_id_no_prefix (GsApp *app)
 {
        gchar *tmp;
        g_return_val_if_fail (GS_IS_APP (app), NULL);
+       if (app->id == NULL)
+               return NULL;
        tmp = g_strrstr (app->id, ":");
        if (tmp != NULL)
                return tmp + 1;


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