From 3caed68cbfac302ed1a3ed7ab2e13c806866aa01 Mon Sep 17 00:00:00 2001 From: Sung-jae Park Date: Tue, 12 Jan 2016 14:54:27 +0900 Subject: [PATCH] Validate the parameter (parent) Before execute the function code. [model] Redwood,Kiran,B3(Wearable) [binary_type] AP [customer] Docomo/Orange/ATT/Open [issue#] N/A [problem] [cause] [solution] [team] HomeTF [request] [horizontal_expansion] Change-Id: I764c4d6bb4f3e9b850f5a41f309fb38784f62a37 --- view.c | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/view.c b/view.c index e6f1baa..48337a2 100644 --- a/view.c +++ b/view.c @@ -4,6 +4,11 @@ */ void view_create(appdata_s *ad) { + if (ad == NULL) { + dlog_print(DLOG_ERROR, LOG_TAG, "appdata is NULL."); + return NULL; + } + /* Create window */ ad->win = view_create_win(); if (ad->win == NULL) { @@ -121,6 +126,11 @@ Evas_Object *view_create_layout_for_conformant(Evas_Object *parent, Evas_Object { Evas_Object *layout = NULL; + if (parent == NULL) { + dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL."); + return NULL; + } + /* Create layout for conformant */ layout = view_create_layout(parent, file_name, group_name, user_data); if (layout == NULL) { @@ -174,6 +184,11 @@ Evas_Object *view_create_layout_for_part(Evas_Object *parent, char *part, char * { Evas_Object *layout = NULL; + if (parent == NULL) { + dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL."); + return NULL; + } + layout = elm_layout_add(parent); elm_layout_file_set(layout, file_name, group_name); evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); @@ -221,9 +236,9 @@ void view_set_image(Evas_Object *parent, const char *part, const char *image_pat { Evas_Object *image = NULL; - if(!parent) { - dlog_print(DLOG_ERROR, LOG_TAG, "failed to parent layout."); - return; + if (parent == NULL) { + dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL."); + return NULL; } image = elm_object_part_content_get(parent, part); @@ -260,8 +275,8 @@ void view_set_image(Evas_Object *parent, const char *part, const char *image_pat void view_set_text(Evas_Object *parent, const char *part, const char *text) { if (parent == NULL) { - dlog_print(DLOG_ERROR, LOG_TAG, "failed to get parent."); - return; + dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL."); + return NULL; } /* Set text of target part object */ @@ -282,8 +297,8 @@ void view_set_color(Evas_Object *parent, const char *part, int r, int g, int b, Evas_Object *obj = NULL; if (parent == NULL) { - dlog_print(DLOG_ERROR, LOG_TAG, "failed to get parent?."); - return; + dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL."); + return NULL; } obj = elm_object_part_content_get(parent, part); @@ -311,8 +326,8 @@ Evas_Object *view_create_naviframe(Evas_Object *parent) Evas_Object *nf = NULL; if (parent == NULL) { - dlog_print(DLOG_ERROR, LOG_TAG, "appdata is NULL."); - return NULL; + dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL."); + return NULL; } nf = elm_naviframe_add(parent); @@ -642,6 +657,11 @@ void view_create_text_popup(Evas_Object *parent, double timeout, const char *tex Evas_Object *popup = NULL; Evas_Object *popup_layout = NULL; + if (parent == NULL) { + dlog_print(DLOG_ERROR, LOG_TAG, "parent is NULL."); + return; + } + popup = elm_popup_add(parent); elm_object_style_set(popup, "circle"); evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); -- 2.7.4