Fix dereference after NULL defects detected by static anlysis tool 08/103108/2
authorJihoon Kim <jihoon48.kim@samsung.com>
Wed, 7 Dec 2016 08:22:46 +0000 (17:22 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Wed, 7 Dec 2016 08:23:29 +0000 (17:23 +0900)
Change-Id: I74393d121cded9fe7cbd96463c818f03147330be
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
src/ise.cpp

index 6574c23..7cf66fb 100644 (file)
@@ -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)