Fix WebProcess B/S Issue
authorSeokju Kwon <seokju.kwon@samsung.com>
Wed, 12 Sep 2012 01:46:36 +0000 (10:46 +0900)
committerSeokju Kwon <seokju.kwon@samsung.com>
Wed, 12 Sep 2012 02:03:52 +0000 (11:03 +0900)
[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

index fd16ede..d389860 100755 (executable)
@@ -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;
 }