From: huiyueun <35286162+huiyueun@users.noreply.github.com> Date: Mon, 20 May 2019 05:07:42 +0000 (+0900) Subject: [NUI] Fix View.HasFocus crash issue (#839) X-Git-Tag: submit/tizen/20190521.005354~1^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4c2984148e61063611f722417b959be1cccc5079;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] Fix View.HasFocus crash issue (#839) Signed-off-by: huiyu.eun --- diff --git a/src/Tizen.NUI/src/public/BaseComponents/View.cs b/src/Tizen.NUI/src/public/BaseComponents/View.cs index 1a52319ea..6f3fe2822 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/View.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/View.cs @@ -4103,8 +4103,16 @@ namespace Tizen.NUI.BaseComponents /// 3 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; }