From d611540452116d549277cb81ef35f963a7be3bf9 Mon Sep 17 00:00:00 2001 From: Seongjun Yim Date: Mon, 26 Aug 2013 19:05:07 +0900 Subject: [PATCH] fix crash issue Change-Id: I331f91f4ed05bfabd2429fb835b648b00e2ec638 Signed-off-by: Seongjun Yim --- src/controls/FWebCtrl_WebImpl.cpp | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/controls/FWebCtrl_WebImpl.cpp b/src/controls/FWebCtrl_WebImpl.cpp index 857dbdb..c8671de 100755 --- a/src/controls/FWebCtrl_WebImpl.cpp +++ b/src/controls/FWebCtrl_WebImpl.cpp @@ -4751,8 +4751,14 @@ _WebImpl::GetParentFormImpl(_ControlImpl* pControlImpl) bool _WebImpl::OnFocusGained(const _ControlImpl& source) { - Ewk_Settings* pSettings = ewk_view_settings_get(__pWebCore->GetWebNativeNode()); - SysAssertf(pSettings, "Failed to get webkit instance."); + Evas_Object* pWebview = __pWebCore->GetWebNativeNode(); + if (!pWebview) + { + return false; + } + + Ewk_Settings* pSettings = ewk_view_settings_get(pWebview); + SysAssertf(pSettings, "Failed to get settings instance."); ewk_settings_clear_text_selection_automatically_set(pSettings, true); return false; @@ -4762,18 +4768,23 @@ _WebImpl::OnFocusGained(const _ControlImpl& source) bool _WebImpl::OnFocusLost(const _ControlImpl& source) { + Evas_Object* pWebview = __pWebCore->GetWebNativeNode(); + if (!pWebview) + { + return false; + } + if(IsKeypadVisible() == true) { SetKeypadOpened(true); - SetKeypadVisibleState(false); } - Ewk_Settings* pSettings = ewk_view_settings_get(__pWebCore->GetWebNativeNode()); - SysAssertf(pSettings, "Failed to get webkit instance."); + Ewk_Settings* pSettings = ewk_view_settings_get(pWebview); + SysAssertf(pSettings, "Failed to get settings instance."); ewk_settings_clear_text_selection_automatically_set(pSettings, false); - evas_object_focus_set(__pWebCore->GetWebNativeNode(), EINA_FALSE); + evas_object_focus_set(pWebview, EINA_FALSE); return false; } -- 2.7.4