edje_edit: adding of NULL-checks
authorperepelits.m <perepelits.m@samsung.com>
Thu, 13 Mar 2014 01:26:20 +0000 (10:26 +0900)
committerCedric BAIL <cedric.bail@samsung.com>
Thu, 13 Mar 2014 01:26:20 +0000 (10:26 +0900)
Summary:
New NULL-checks have been added in:

edje_edit_state_color_class_set
edje_edit_state_external_param_get
edje_edit_state_external_param_int_get
edje_edit_state_external_param_bool_get
edje_edit_state_external_param_double_get
edje_edit_state_external_param_string_get
edje_edit_state_external_param_choice_get
edje_edit_state_external_param_set

Reviewers: cedric, seoz, raster

Reviewed By: cedric

CC: reutskiy.v.v, cedric
Differential Revision: https://phab.enlightenment.org/D629

src/lib/edje/edje_edit.c

index 4bf1531487ea61cd7c9d9247d178286050957a00..d87ff078d26ce79c0eddb1a7f7c7d0e62afa7375 100644 (file)
@@ -4013,6 +4013,12 @@ edje_edit_state_color_class_set(Evas_Object *obj, const char *part, const char *
    if ((!obj) || (!part) || (!state)) return EINA_FALSE;
    GET_PD_OR_RETURN(EINA_FALSE);
 
+   if (!color_class) 
+     {
+           pd->color_class = NULL;
+           return EINA_FALSE;
+     }
+
    if (!ed->file->color_classes) return EINA_FALSE;
    EINA_LIST_FOREACH(ed->file->color_classes, l, cc)
      {
@@ -4070,6 +4076,9 @@ edje_edit_state_external_param_get(Evas_Object *obj, const char *part, const cha
    if (rp->part->type != EDJE_PART_TYPE_EXTERNAL)
      return EINA_FALSE;
 
+   if (!param)
+     return EINA_FALSE;
+
    external = (Edje_Part_Description_External *) pd;
 
    EINA_LIST_FOREACH(external->external_params, l, p)
@@ -4114,6 +4123,9 @@ edje_edit_state_external_param_int_get(Evas_Object *obj, const char *part, const
         return EINA_FALSE;
      }
 
+   if (!param)
+     return EINA_FALSE;
+
    external = (Edje_Part_Description_External *) pd;
 
    EINA_LIST_FOREACH(external->external_params, l, p)
@@ -4144,6 +4156,9 @@ edje_edit_state_external_param_bool_get(Evas_Object *obj, const char *part, cons
         return EINA_FALSE;
      }
 
+   if (!param)
+     return EINA_FALSE;
+
    external = (Edje_Part_Description_External *) pd;
 
    EINA_LIST_FOREACH(external->external_params, l, p)
@@ -4174,6 +4189,9 @@ edje_edit_state_external_param_double_get(Evas_Object *obj, const char *part, co
         return EINA_FALSE;
      }
 
+   if (!param)
+     return EINA_FALSE;
+
    external = (Edje_Part_Description_External *) pd;
 
    EINA_LIST_FOREACH(external->external_params, l, p)
@@ -4204,6 +4222,9 @@ edje_edit_state_external_param_string_get(Evas_Object *obj, const char *part, co
         return EINA_FALSE;
      }
 
+   if (!param)
+     return EINA_FALSE;
+
    external = (Edje_Part_Description_External *) pd;
 
    EINA_LIST_FOREACH(external->external_params, l, p)
@@ -4234,6 +4255,9 @@ edje_edit_state_external_param_choice_get(Evas_Object *obj, const char *part, co
         return EINA_FALSE;
      }
 
+   if (!param)
+     return EINA_FALSE;
+
    external = (Edje_Part_Description_External *) pd;
 
    EINA_LIST_FOREACH(external->external_params, l, p)
@@ -4263,6 +4287,9 @@ edje_edit_state_external_param_set(Evas_Object *obj, const char *part, const cha
    if (rp->part->type != EDJE_PART_TYPE_EXTERNAL)
      return EINA_FALSE;
 
+   if (!param)
+     return EINA_FALSE;
+
    external = (Edje_Part_Description_External *) pd;
 
    va_start(ap, type);