From 4c2984148e61063611f722417b959be1cccc5079 Mon Sep 17 00:00:00 2001 From: huiyueun <35286162+huiyueun@users.noreply.github.com> Date: Mon, 20 May 2019 14:07:42 +0900 Subject: [PATCH] [NUI] Fix View.HasFocus crash issue (#839) Signed-off-by: huiyu.eun --- src/Tizen.NUI/src/public/BaseComponents/View.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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; } -- 2.34.1