Add null check on GetStates 03/297703/5
authorHosang Kim <hosang12.kim@samsung.com>
Wed, 23 Aug 2023 03:16:12 +0000 (12:16 +0900)
committerkim hosang <hosang12.kim@samsung.com>
Tue, 12 Dec 2023 08:53:24 +0000 (08:53 +0000)
Sometimes accessible parent is null, so add checking null.

Change-Id: I2b8edcc5fe8b5fae87ad9f813fa5f6922cbbd481

dali/devel-api/adaptor-framework/accessibility.cpp

index bba8f1d..8b7a10f 100644 (file)
@@ -445,12 +445,17 @@ public:
       state[State::VISIBLE]   = true;
       state[State::ACTIVE]    = visible;
     }
-    else
+    else if (GetParent())
     {
       auto parentState      = GetParent()->GetStates();
       state[State::SHOWING] = parentState[State::SHOWING];
       state[State::VISIBLE] = parentState[State::VISIBLE];
     }
+    else
+    {
+      state[State::SHOWING] = false;
+      state[State::VISIBLE] = false;
+    }
     return state;
   }