[Tizen] Fix svace issue (accessible null check) 72/303372/1
authorEunki, Hong <eunkiki.hong@samsung.com>
Wed, 20 Dec 2023 04:02:14 +0000 (13:02 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Wed, 27 Dec 2023 00:15:27 +0000 (09:15 +0900)
Change-Id: I71afc8e98a9e8eef985130757091cd8e5fed4182
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
dali-toolkit/internal/controls/control/control-data-impl.cpp

index f434dc1..9feff1c 100644 (file)
@@ -719,20 +719,22 @@ void Control::Impl::UnregisterAccessibilityPropertySetSignal()
 void Control::Impl::OnAccessibilityPropertySet(Dali::Handle& handle, Dali::Property::Index index, const Dali::Property::Value& value)
 {
   auto* accessible = GetAccessibleObject();
-
-  if(mAccessibilityGetNameSignal.Empty())
+  if(DALI_LIKELY(accessible))
   {
-    if(index == DevelControl::Property::ACCESSIBILITY_NAME || (mAccessibilityName.empty() && index == accessible->GetNamePropertyIndex()))
+    if(mAccessibilityGetNameSignal.Empty())
     {
-      accessible->Emit(Dali::Accessibility::ObjectPropertyChangeEvent::NAME);
+      if(index == DevelControl::Property::ACCESSIBILITY_NAME || (mAccessibilityName.empty() && index == accessible->GetNamePropertyIndex()))
+      {
+        accessible->Emit(Dali::Accessibility::ObjectPropertyChangeEvent::NAME);
+      }
     }
-  }
 
-  if(mAccessibilityGetDescriptionSignal.Empty())
-  {
-    if(index == DevelControl::Property::ACCESSIBILITY_DESCRIPTION || (mAccessibilityDescription.empty() && index == accessible->GetDescriptionPropertyIndex()))
+    if(mAccessibilityGetDescriptionSignal.Empty())
     {
-      accessible->Emit(Dali::Accessibility::ObjectPropertyChangeEvent::DESCRIPTION);
+      if(index == DevelControl::Property::ACCESSIBILITY_DESCRIPTION || (mAccessibilityDescription.empty() && index == accessible->GetDescriptionPropertyIndex()))
+      {
+        accessible->Emit(Dali::Accessibility::ObjectPropertyChangeEvent::DESCRIPTION);
+      }
     }
   }
 }