From 6d8b9bf51bccf58c6032fe51dca29dd993bfb892 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Wed, 7 Dec 2016 17:22:46 +0900 Subject: [PATCH] Fix dereference after NULL defects detected by static anlysis tool Change-Id: I74393d121cded9fe7cbd96463c818f03147330be Signed-off-by: Jihoon Kim --- src/ise.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ise.cpp b/src/ise.cpp index 6574c23..7cf66fb 100644 --- a/src/ise.cpp +++ b/src/ise.cpp @@ -954,8 +954,8 @@ SCLEventReturnType CUIEventCallback::on_event_notification(SCLUINotiType noti_ty punc_pos++; } SclNotiPopupOpeningDesc *openingDesc = (SclNotiPopupOpeningDesc *)etc_info; - if (0 == strcmp(openingDesc->input_mode, "CM_POPUP")) { - if (ise_is_emoticons_disabled() && g_ui) + if (g_ui && 0 == strcmp(openingDesc->input_mode, "CM_POPUP")) { + if (ise_is_emoticons_disabled()) g_ui->enable_button("EMOTICON_KEY", false); else g_ui->enable_button("EMOTICON_KEY", true); @@ -1824,6 +1824,8 @@ void ise_set_return_key_type(unsigned int type) const int BUF_LEN = 256; char buf[BUF_LEN] = {0}; + if (!g_ui) return; + LOGD("return key type : %d\n", type); switch (type) { @@ -1885,7 +1887,8 @@ void ise_set_return_key_type(unsigned int type) void ise_set_return_key_disable(unsigned int disabled) { LOGD("enable : %d\n", !disabled); - g_ui->enable_button("Enter", !disabled); + if (g_ui) + g_ui->enable_button("Enter", !disabled); } void ise_get_language_locale(char **locale) -- 2.7.4