From e5c54aaceedeab828fb5e0751c55c1a68dbf1ed4 Mon Sep 17 00:00:00 2001 From: Seokju Kwon Date: Wed, 12 Sep 2012 10:46:36 +0900 Subject: [PATCH] Fix WebProcess B/S Issue [Title] Fix WebProcess B/S Issue [Issue#] N/A [Problem] Occur B/S [Cause] Ecore-ime call retrieve_surrounding_callback for only getting the positon of cursor [Solution] Check null pointer Change-Id: Ia4687fb8f110098414a8cce39f1f4a2bc2a3dcbe --- Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp b/Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp index fd16ede..d389860 100755 --- a/Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp +++ b/Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp @@ -107,11 +107,15 @@ static Eina_Bool imfRetrieveSurroundingCb(void* client, Ecore_IMF_Context* conte if (!pageClient->page()->focusedFrame()) return EINA_FALSE; - *cursorPos = pageClient->page()->getCursorOffsetPosition(); - String content = pageClient->page()->getContentOfPosition(); - *text = content.length() ? strdup(content.utf8().data()) : strdup(""); + if (cursorPos) + *cursorPos = pageClient->page()->getCursorOffsetPosition(); - LOG(ISF, "Retrieve surrounding text : %s pos : %d\n", *text, *cursorPos); + if (text) { + String content = pageClient->page()->getContentOfPosition(); + *text = content.length() ? strdup(content.utf8().data()) : strdup(""); + } + + LOG(ISF, "Retrieve surrounding text : %s pos : %d\n", text ? *text : "NULL", cursorPos ? *cursorPos : 0); return EINA_TRUE; } -- 2.7.4