Modified missing NULL check when using libscl-ui 74/101674/1
authorJi-hoon Lee <dalton.lee@samsung.com>
Fri, 2 Dec 2016 02:14:22 +0000 (11:14 +0900)
committerJi-hoon Lee <dalton.lee@samsung.com>
Fri, 2 Dec 2016 02:14:22 +0000 (11:14 +0900)
Change-Id: Idae719f5cbb05471ba106b39beef7a89e68b8ce3

src/ise-stt-mode.cpp
src/ise.cpp

index 8ca87cb..f94da09 100644 (file)
@@ -791,11 +791,13 @@ void ise_show_stt_mode(Evas_Object *win)
     const int BUF_LEN = 256;
     static char buf[BUF_LEN] = {0};
     snprintf(buf, BUF_LEN, gettext("IDS_ST_SK_CANCEL"));
-    g_ui->set_string_substitution("Cancel", buf);
+    if (g_ui)
+        g_ui->set_string_substitution("Cancel", buf);
 }
 
 void ise_hide_stt_mode()
 {
     destroy_voice();
-    g_ui->unset_string_substitution("Cancel");
+    if (g_ui)
+        g_ui->unset_string_substitution("Cancel");
 }
index 61a1efe..087d82a 100644 (file)
@@ -129,10 +129,12 @@ class CandidateEventListener: public EventListener
                 case MultiEventDesc::CANDIDATE_MORE_VIEW_SHOW:
                     // when more parts shows, click on the candidate will
                     // not affect the key click event
-                    g_ui->disable_input_events(TRUE);
+                    if (g_ui)
+                        g_ui->disable_input_events(TRUE);
                     break;
                 case MultiEventDesc::CANDIDATE_MORE_VIEW_HIDE:
-                    g_ui->disable_input_events(FALSE);
+                    if (g_ui)
+                        g_ui->disable_input_events(FALSE);
                     break;
                 default: break;
             }
@@ -405,7 +407,8 @@ void CCoreEventCallback::on_ise_show(sclint ic, const sclint degree, Ise_Context
     //g_ise_common->set_keyboard_ise_by_uuid(KEYBD_ISE_UUID);
 
     /* Don't update screen until all the information is correctly set */
-    g_ui->set_update_pending(TRUE);
+    if (g_ui)
+        g_ui->set_update_pending(TRUE);
 
     ise_reset_context(); // reset ISE
 
@@ -434,7 +437,8 @@ void CCoreEventCallback::on_ise_show(sclint ic, const sclint degree, Ise_Context
     ::ise_show(ic);
 
     /* Now we update the whole screen */
-    g_ui->set_update_pending(FALSE);
+    if (g_ui)
+        g_ui->set_update_pending(FALSE);
 }
 
 void CCoreEventCallback::on_ise_hide(sclint ic, const sclchar *ic_uuid)
@@ -945,12 +949,13 @@ SCLEventReturnType CUIEventCallback::on_event_notification(SCLUINotiType noti_ty
         int punc_pos = 0;
         for (; iter != g_recent_used_punctuation.rend(); ++iter)
         {
-            g_ui->set_string_substitution(g_current_punctuation[punc_pos].c_str(), iter->c_str());
+            if (g_ui)
+                g_ui->set_string_substitution(g_current_punctuation[punc_pos].c_str(), iter->c_str());
             punc_pos++;
         }
         SclNotiPopupOpeningDesc *openingDesc = (SclNotiPopupOpeningDesc *)etc_info;
         if (0 == strcmp(openingDesc->input_mode, "CM_POPUP")) {
-            if (ise_is_emoticons_disabled())
+            if (ise_is_emoticons_disabled() && g_ui)
                 g_ui->enable_button("EMOTICON_KEY", false);
             else
                 g_ui->enable_button("EMOTICON_KEY", true);