aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-06-18 08:41:33 -0500
committerTed Gould <ted@gould.cx>2010-06-18 08:41:33 -0500
commitd4f5fa77e921df815bd67080167a461c51791a26 (patch)
treee2cc83d80455f1add09535bad229da5d75f0b286
parentce25d4c9ac44237bb1f38576e99de3533489bd74 (diff)
downloadayatana-indicator-application-d4f5fa77e921df815bd67080167a461c51791a26.tar.gz
ayatana-indicator-application-d4f5fa77e921df815bd67080167a461c51791a26.tar.bz2
ayatana-indicator-application-d4f5fa77e921df815bd67080167a461c51791a26.zip
Remove the assert with checking if the value is NULL.
-rw-r--r--src/application-service-appstore.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c
index 66e3cf3..15abea3 100644
--- a/src/application-service-appstore.c
+++ b/src/application-service-appstore.c
@@ -246,10 +246,14 @@ string_to_status(const gchar * status_string)
GEnumClass * klass = G_ENUM_CLASS(g_type_class_ref(APP_INDICATOR_TYPE_INDICATOR_STATUS));
g_return_val_if_fail(klass != NULL, APP_INDICATOR_STATUS_PASSIVE);
- GEnumValue * val = g_enum_get_value_by_nick(klass, status_string);
- g_return_val_if_fail(val != NULL, APP_INDICATOR_STATUS_PASSIVE);
+ AppIndicatorStatus retval = APP_INDICATOR_STATUS_PASSIVE;
- AppIndicatorStatus retval = (AppIndicatorStatus)val->value;
+ GEnumValue * val = g_enum_get_value_by_nick(klass, status_string);
+ if (val == NULL) {
+ g_warning("Unrecognized status '%s' assuming passive.", status_string);
+ } else {
+ retval = (AppIndicatorStatus)val->value;
+ }
g_type_class_unref(klass);