Return empty surrounding text when no focused client available 56/109856/3
authorJi-hoon Lee <dalton.lee@samsung.com>
Thu, 12 Jan 2017 04:48:49 +0000 (13:48 +0900)
committerJi-hoon Lee <dalton.lee@samsung.com>
Thu, 12 Jan 2017 05:08:08 +0000 (21:08 -0800)
Change-Id: I13b6c30bbf1a1d2e671ef583ab29f44fd8420a8a

ism/src/isf_info_manager.cpp

index 1f8bb49..2d275cb 100644 (file)
@@ -3379,8 +3379,14 @@ client context helpers: %d, helpers uuid count: %d",
         String  focused_uuid = get_focused_context (focused_client, focused_context);
         ClientInfo client_info = socket_get_client_info (focused_client);
 
-        if (client_info.type == FRONTEND_CLIENT) {
-            m_panel_agent_manager.socket_helper_get_surrounding_text (focused_client, focused_context, maxlen_before, maxlen_after);
+        /* If the get_surrounding_text was received when there is no client available,
+         * return empty surrounding text since the sender would be waiting for reply */
+        if (focused_client == -1) {
+            socket_update_surrounding_text("", 0);
+        } else {
+            if (client_info.type == FRONTEND_CLIENT) {
+                m_panel_agent_manager.socket_helper_get_surrounding_text (focused_client, focused_context, maxlen_before, maxlen_after);
+            }
         }
     }
     //SCIM_TRANS_CMD_DELETE_SURROUNDING_TEXT