enventor_smart: add NULL checking

Summary:
add NULL checking in syntax_color_set and syntax_color_get API
@fix

Reviewers: Jaehyun_Cho, NikaWhite, bowonryu, Hermet

Reviewed By: Hermet

Differential Revision: https://phab.enlightenment.org/D4233
This commit is contained in:
Taehyub Kim 2016-08-17 22:21:16 +09:00 committed by Hermet Park
parent e646da1ee0
commit 1665ac9ba6
1 changed files with 8 additions and 2 deletions

View File

@ -743,7 +743,10 @@ _enventor_object_syntax_color_set(Eo *obj EINA_UNUSED,
if ((color_type < ENVENTOR_SYNTAX_COLOR_STRING) ||
(color_type >= ENVENTOR_SYNTAX_COLOR_LAST))
EINA_LOG_ERR("Invalid color_type(%d)", color_type);
{
EINA_LOG_ERR("Invalid color_type(%d)", color_type);
return;
}
eina_stringshare_del(pd->text_color_val[color_type]);
pd->text_color_val[color_type] = eina_stringshare_add(val);
@ -766,7 +769,10 @@ _enventor_object_syntax_color_get(Eo *obj EINA_UNUSED,
{
if ((color_type < ENVENTOR_SYNTAX_COLOR_STRING) ||
(color_type >= ENVENTOR_SYNTAX_COLOR_LAST))
EINA_LOG_ERR("Invalid color_type(%d)", color_type);
{
EINA_LOG_ERR("Invalid color_type(%d)", color_type);
return NULL;
}
//Return overriden color values or defaults.
if (pd->text_color_val[color_type])