summaryrefslogtreecommitdiff
path: root/src/lib/efl
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2020-03-12 12:50:26 -0400
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2020-03-12 18:05:10 +0100
commiteaa06230ddf53a444e37e66034b0e4f8f4b2b0af (patch)
treec97e030be1c5089b2afd71c5a7228fb30e083b6d /src/lib/efl
parent765c5c2a0b2c28c4b8497b28ffbd64f159a446d6 (diff)
downloadefl-eaa06230ddf53a444e37e66034b0e4f8f4b2b0af.tar.gz
efl: check config values before passing to non-null function
if these config values don't exist, we should return the inlined defaults Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D11499
Diffstat (limited to 'src/lib/efl')
-rw-r--r--src/lib/efl/Efl.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/efl/Efl.h b/src/lib/efl/Efl.h
index 81e274883b..ec6f168a8b 100644
--- a/src/lib/efl/Efl.h
+++ b/src/lib/efl/Efl.h
@@ -253,7 +253,7 @@ efl_config_bool_get(const Efl_Config *obj, const char * name)
{
Eina_Value *v = efl_config_get(obj, name);
Eina_Bool b = 0;
- if (eina_value_type_get(v) == EINA_VALUE_TYPE_UCHAR)
+ if (v && eina_value_type_get(v) == EINA_VALUE_TYPE_UCHAR)
eina_value_get(v, &b);
eina_value_free(v);
return b;
@@ -275,7 +275,7 @@ efl_config_int_get(const Efl_Config *obj, const char * name)
{
Eina_Value *v = efl_config_get(obj, name);
int b = 0;
- if (eina_value_type_get(v) == EINA_VALUE_TYPE_INT)
+ if (v && eina_value_type_get(v) == EINA_VALUE_TYPE_INT)
eina_value_get(v, &b);
eina_value_free(v);
return b;
@@ -297,7 +297,7 @@ efl_config_double_get(const Efl_Config *obj, const char * name)
{
Eina_Value *v = efl_config_get(obj, name);
double b = 0;
- if (eina_value_type_get(v) == EINA_VALUE_TYPE_DOUBLE)
+ if (v && eina_value_type_get(v) == EINA_VALUE_TYPE_DOUBLE)
eina_value_get(v, &b);
eina_value_free(v);
return b;
@@ -319,7 +319,7 @@ efl_config_string_get(const Efl_Config *obj, const char *name)
{
Eina_Value *v = efl_config_get(obj, name);
Eina_Stringshare *s = 0;
- if (eina_value_type_get(v) == EINA_VALUE_TYPE_STRING)
+ if (v && eina_value_type_get(v) == EINA_VALUE_TYPE_STRING)
{
const char *b = 0;
eina_value_get(v, &b);