[NUI] Fix View.HasFocus crash issue (#839)
authorhuiyueun <35286162+huiyueun@users.noreply.github.com>
Mon, 20 May 2019 05:07:42 +0000 (14:07 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Mon, 20 May 2019 05:07:42 +0000 (14:07 +0900)
Signed-off-by: huiyu.eun <huiyu.eun@samsung.com>
src/Tizen.NUI/src/public/BaseComponents/View.cs

index 1a52319ea4c6995b224f52b13f34def1ddae3ebe..6f3fe282212202325f06732f1c92124c960308b9 100755 (executable)
@@ -4103,8 +4103,16 @@ namespace Tizen.NUI.BaseComponents
         /// <since_tizen> 3 </since_tizen>
         public bool HasFocus()
         {
-            bool ret = Interop.View.View_HasKeyInputFocus(swigCPtr);
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            bool ret = false;
+            if (swigCPtr.Handle != global::System.IntPtr.Zero)
+            {
+                ret = Interop.View.View_HasKeyInputFocus(swigCPtr);
+                               if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            }
+            else
+            {
+                Tizen.Log.Error("NUI", "swigCPtr of view is aleady disposed.");
+            }
             return ret;
         }