[NUI] Fix manual TCT crash issue only on TV target
authordongsug.song <dongsug.song@samsung.com>
Thu, 28 Mar 2024 12:33:00 +0000 (21:33 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Thu, 28 Mar 2024 12:48:25 +0000 (21:48 +0900)
src/Tizen.NUI.Components/Controls/Control.cs

index 3007d93..eec308f 100755 (executable)
@@ -164,13 +164,24 @@ namespace Tizen.NUI.Components
 
         private bool OnTouchPlayFeedback(object source, TouchEventArgs e)
         {
-            if (Feedback && e?.Touch.GetState(0) == PointStateType.Down)
+            try
             {
-                if (feedback != null && feedback.IsSupportedPattern(FeedbackType.Sound, "Tap"))
+                if (Feedback && e?.Touch.GetState(0) == PointStateType.Down)
                 {
-                    feedback.Play(FeedbackType.Sound, "Tap");
+                    if (feedback != null && feedback.IsSupportedPattern(FeedbackType.Sound, "Tap"))
+                    {
+                        feedback.Play(FeedbackType.Sound, "Tap");
+                    }
                 }
             }
+            catch (NotSupportedException ex)
+            {
+                Log.Error("NUI", $"[ERROR] No support of Feedback: {ex}");
+            }
+            catch (InvalidOperationException ex)
+            {
+                Log.Error("NUI", $"[ERROR] Fail to initialize Feedback: {ex}");
+            }
             return false;
         }