fix crash issue
authorSeongjun Yim <se201.yim@samsung.com>
Mon, 26 Aug 2013 10:05:07 +0000 (19:05 +0900)
committerSeongjun Yim <se201.yim@samsung.com>
Mon, 26 Aug 2013 10:37:49 +0000 (19:37 +0900)
Change-Id: I331f91f4ed05bfabd2429fb835b648b00e2ec638
Signed-off-by: Seongjun Yim <se201.yim@samsung.com>
src/controls/FWebCtrl_WebImpl.cpp

index 857dbdb..c8671de 100755 (executable)
@@ -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;
 }