From e6da285d4748fb665915029b0e6fd90b34b17631 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Thu, 12 Jan 2017 13:48:49 +0900 Subject: [PATCH] Return empty surrounding text when no focused client available Change-Id: I13b6c30bbf1a1d2e671ef583ab29f44fd8420a8a --- ism/src/isf_info_manager.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ism/src/isf_info_manager.cpp b/ism/src/isf_info_manager.cpp index 1f8bb49..2d275cb 100644 --- a/ism/src/isf_info_manager.cpp +++ b/ism/src/isf_info_manager.cpp @@ -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 -- 2.7.4