From: Wonnam Jang Date: Mon, 2 Jan 2017 09:49:02 +0000 (+0900) Subject: Add defence code when widget command is not registered X-Git-Tag: accepted/tizen/common/20170117.174615~3^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c03e6c1e5c835f3a211efaa4cde12be2dbee4f69;p=platform%2Fcore%2Fuifw%2Fvoice-control.git Add defence code when widget command is not registered Change-Id: Iebb921fc11044f46b0075d90c9da200c106ff539 Signed-off-by: Wonnam Jang (cherry picked from commit 69e68b702425f2d1f74151d107c1d43623bd4606) --- diff --git a/client/vc_widget.c b/client/vc_widget.c index 3989c99..9d3f835 100644 --- a/client/vc_widget.c +++ b/client/vc_widget.c @@ -1007,6 +1007,11 @@ static Eina_Bool __vc_widget_start_recording(void *data) if (NULL != vc_cmd_list) { vc_cmd_list_s* list = NULL; list = (vc_cmd_list_s*)vc_cmd_list; + if (NULL == list || NULL == list->list) { + SLOG(LOG_ERROR, TAG_VCW, "[ERROR] No registered commands from send_command_list_cb"); + break; + } + ret = vc_cmd_parser_save_file(getpid(), VC_COMMAND_TYPE_WIDGET, list->list, NULL); if (0 == ret) { /* widget command is valid */ @@ -1023,7 +1028,10 @@ static Eina_Bool __vc_widget_start_recording(void *data) } } - SLOG(LOG_DEBUG, TAG_VCW, "[CHECK] command list (%d)", g_slist_length(((vc_cmd_list_s*)vc_cmd_list)->list)); + if (NULL != vc_cmd_list) + SLOG(LOG_DEBUG, TAG_VCW, "[CHECK] command list (%d)", g_slist_length(((vc_cmd_list_s*)vc_cmd_list)->list)); + else + SLOG(LOG_DEBUG, TAG_VCW, "[CHECK] command list (NULL)"); ret = -1; count = 0; @@ -1048,6 +1056,7 @@ static Eina_Bool __vc_widget_start_recording(void *data) return EINA_FALSE; } + static Eina_Bool __vc_widget_notify_tooltip(void *data) { bool show = (bool)data;