Fix issue detected by static analysis tool 62/244762/1
authorJihoon Kim <jihoon48.kim@samsung.com>
Thu, 24 Sep 2020 04:59:18 +0000 (13:59 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Thu, 24 Sep 2020 04:59:18 +0000 (13:59 +0900)
Change-Id: I653bdb2a2f26c1f3cdcfaa84173261b19f5a0582
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
src/e_mod_main.c

index 99b977f..763ab81 100644 (file)
@@ -1477,24 +1477,33 @@ _e_text_input_cb_input_panel_show(struct wl_client *client, struct wl_resource *
      }
 #endif
 
-   if (input_method && input_method->resource && input_method->context && input_method->context->resource)
+   if (input_method)
      {
-        /* DO NOT show input panel surface until we get message "show complete" from input method,
-         * in order to give a change to update UI */
-        LOGD("IM::SHOW::WAIT_FOR_READY\n");
+        if (input_method->resource && input_method->context && input_method->context->resource)
+          {
+             /* DO NOT show input panel surface until we get message "show complete" from input method,
+              * in order to give a change to update UI */
+             LOGD("IM::SHOW::WAIT_FOR_READY\n");
 
-        g_show_client = client;
-        wl_input_method_send_show_input_panel(input_method->resource, input_method->context->resource);
+             g_show_client = client;
+             wl_input_method_send_show_input_panel(input_method->resource, input_method->context->resource);
 
-        /* we need to force update in order to release buffer
-         * if we do not, client can't update
-         * because they may in manual render state by frame callback mechanism,
-         * and also don't have released buffer */
-        e_input_panel_wait_update_set(EINA_TRUE);
+             /* we need to force update in order to release buffer
+              * if we do not, client can't update
+              * because they may in manual render state by frame callback mechanism,
+              * and also don't have released buffer */
+             e_input_panel_wait_update_set(EINA_TRUE);
+          }
+        else
+          {
+             LOGW("Failed to send show input panel. inputmethod : %p, input_method->resource : %p, input_method->context : %p", input_method, input_method->resource, input_method->context);
+             if (input_method->context)
+               LOGW("Failed to send show input panel. input_method->context->resource : %p", input_method->context->resource);
+          }
      }
    else
      {
-        LOGW("Failed to send show input panel. inputmethod : %p, input_method->resource : %p, input_method->context : %p, input_method->context->resource : %p", input_method, input_method->resource, input_method->context, input_method->context->resource);
+        LOGW("No input method");
      }
 
    /* If the input panel state was WILL_HIDE, it means that the conformant area information needs to be restored */