X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fbuttons%2Ftoggle-button-impl.cpp;h=ef562029f781d94af01dd0fb29799d08dbdc5784;hb=263ae2a3d79784a3ebc4a1d6b5db8bf6bb407468;hp=d85f8fd0f6a2ec7c3545fadb43ec33cdf98c109b;hpb=082eb264d1f4fe0639151e7770c371e51e5f3748;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/controls/buttons/toggle-button-impl.cpp b/dali-toolkit/internal/controls/buttons/toggle-button-impl.cpp index d85f8fd..ef56202 100644 --- a/dali-toolkit/internal/controls/buttons/toggle-button-impl.cpp +++ b/dali-toolkit/internal/controls/buttons/toggle-button-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -404,9 +404,11 @@ void ToggleButton::OnStateChange(State newState) if((Self() == Dali::Accessibility::Accessible::GetCurrentlyHighlightedActor()) && (newState == SELECTED_STATE || newState == UNSELECTED_STATE)) { auto* accessible = GetAccessibleObject(); - - accessible->EmitStateChanged(Dali::Accessibility::State::CHECKED, mCurrentToggleIndex ? 1 : 0, 0); - accessible->Emit(Dali::Accessibility::ObjectPropertyChangeEvent::DESCRIPTION); + if(DALI_LIKELY(accessible)) + { + accessible->EmitStateChanged(Dali::Accessibility::State::CHECKED, mCurrentToggleIndex ? 1 : 0, 0); + accessible->Emit(Dali::Accessibility::ObjectPropertyChangeEvent::DESCRIPTION); + } } }