[NUI] Add Window validation check
authordongsug.song <dongsug.song@samsung.com>
Fri, 16 Jun 2023 13:00:06 +0000 (22:00 +0900)
committerJaehyun Cho <jaehyun0cho@gmail.com>
Wed, 21 Jun 2023 03:04:41 +0000 (12:04 +0900)
src/Tizen.NUI/src/internal/Application/Application.cs
src/Tizen.NUI/src/internal/Common/DaliEnumConstants.cs

index 34ad382..1374a59 100755 (executable)
@@ -1845,6 +1845,12 @@ namespace Tizen.NUI
         [EditorBrowsable(EditorBrowsableState.Never)]
         public static List<Window> GetWindowList()
         {
+            if (Interop.Stage.IsInstalled() == false)
+            {
+                NUILog.ErrorBacktrace($"[ERROR] dali adaptor and dali window is not ready. just return NULL here");
+                return null;
+            }
+
             uint ListSize = Interop.Application.GetWindowsListSize();
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
 
index afb7403..b97b81e 100755 (executable)
@@ -238,6 +238,22 @@ namespace Tizen.NUI
         {
             Tizen.Log.Error("NUI", $"{msg} (at line {lineNum} of {caller} in {file})\n");
         }
+
+        public static void ErrorBacktrace(string msg,
+            [CallerLineNumber] int lineNum = 0,
+            [CallerMemberName] string caller = null,
+            [CallerFilePath] string file = null
+        )
+        {
+            Tizen.Log.Error("NUI", $"[ERR]{msg} (at line {lineNum} of {caller} in {file})\n");
+            Tizen.Log.Error("NUI", $"[ERR] Back Trace =>");
+            global::System.Diagnostics.StackTrace st = new global::System.Diagnostics.StackTrace(true);
+            for (int i = 0; i < st.FrameCount; i++)
+            {
+                global::System.Diagnostics.StackFrame sf = st.GetFrame(i);
+                Tizen.Log.Error("NUI", " Method " + sf.GetMethod());
+            }
+        }
     }
 
 }