[gnome-robots/wip/libgames-support: 15/22] Return NULL as category if non standard category key.



commit d46e732bd54c5ce7fd4756c35265b14d0d29271c
Author: Nikhar Agrawal <nikharagrawal2006 gmail com>
Date:   Mon Aug 18 01:55:56 2014 +0530

    Return NULL as category if non standard category key.

 src/gnome-robots.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/gnome-robots.c b/src/gnome-robots.c
index d318fe5..3b2cd18 100644
--- a/src/gnome-robots.c
+++ b/src/gnome-robots.c
@@ -325,12 +325,14 @@ gchar* name_from_key (gchar* key)
       return scorecats[i].name;
   }
   /*Return key as is if match not found*/
-  return key;
+  return NULL;
 }
 
 GamesScoresCategory *create_category_from_key (GamesScoresContext *context, const char *key, gpointer 
user_data)
 {
   gchar *name = name_from_key (key);
+  if (name == NULL)
+    return NULL;
   return games_scores_category_new (key, name);
 }
 


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