From: Lukasz Oleksak Date: Wed, 7 Oct 2020 11:18:19 +0000 (+0200) Subject: [AT-SPI] Guard added for potential null pointer dereference X-Git-Tag: dali_2.0.0~6^2~4 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=720a51a3c0649be2b4dc464a7153b5162c47d2ea [AT-SPI] Guard added for potential null pointer dereference Change-Id: Ib0fdcdf42d43f98e95d544fc27693b94282afb41 --- diff --git a/dali-toolkit/internal/controls/buttons/button-impl.cpp b/dali-toolkit/internal/controls/buttons/button-impl.cpp index 1f5510d..b696a52 100644 --- a/dali-toolkit/internal/controls/buttons/button-impl.cpp +++ b/dali-toolkit/internal/controls/buttons/button-impl.cpp @@ -1316,16 +1316,20 @@ Padding Button::GetForegroundPadding() std::string Button::AccessibleImpl::GetNameRaw() { + std::string labelText; auto slf = Toolkit::Button::DownCast( self ); + Property::Map labelMap = slf.GetProperty( Toolkit::Button::Property::LABEL ); - Property::Map label = slf.GetProperty( Toolkit::Button::Property::LABEL ); - - std::string labelText; - label.Find( Toolkit::TextVisual::Property::TEXT )->Get( labelText ); + Property::Value* textPropertyPtr = labelMap.Find( Toolkit::TextVisual::Property::TEXT ); + if ( textPropertyPtr ) + { + textPropertyPtr->Get( labelText ); + } return labelText; } + Property::Index Button::AccessibleImpl::GetNamePropertyIndex() { Property::Index label = Toolkit::Button::Property::LABEL;