[gnome-robots] Return NULL as category if non standard category key.



commit af1d4943f897a10321ad9905c46df2a4604acc86
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 b2328b3..f8de478 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]