[Tizen] Add null check on GetStates 52/303852/1
authorHosang Kim <hosang12.kim@samsung.com>
Wed, 23 Aug 2023 03:16:12 +0000 (12:16 +0900)
committerEunki Hong <eunkiki.hong@samsung.com>
Sun, 7 Jan 2024 01:07:09 +0000 (10:07 +0900)
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;
   }