[gnome-software/wip/rancell/reviews] Revert "Fix a crash when the category is NULL."



commit 28e8bd21f91a8d459319cb52207d563226c0f93b
Author: William Hua <william hua canonical com>
Date:   Wed Mar 2 07:15:47 2016 -0500

    Revert "Fix a crash when the category is NULL."
    
    This reverts commit 7ba4c264a6eaff0ec694e384de001b25c49a7e04.

 src/gs-folders.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)
---
diff --git a/src/gs-folders.c b/src/gs-folders.c
index c290f51..f4abca4 100644
--- a/src/gs-folders.c
+++ b/src/gs-folders.c
@@ -450,18 +450,12 @@ static GsFolder *
 get_app_folder (GsFolders *folders, const gchar *app, GPtrArray *categories)
 {
        GsFolder *folder;
-       const gchar *category;
        guint i;
 
        folder = g_hash_table_lookup (folders->apps, app);
        if (!folder && categories) {
                for (i = 0; i < categories->len; i++) {
-                       category = g_ptr_array_index (categories, i);
-                       if (!category) {
-                               continue;
-                       }
-
-                       folder = g_hash_table_lookup (folders->categories, category);
+                       folder = g_hash_table_lookup (folders->categories, g_ptr_array_index (categories, i));
                        if (folder) {
                                break;
                        }


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