From 6d8613dfb673d3419d9ed0802db5e7c36069b935 Mon Sep 17 00:00:00 2001 From: fesseha-eve <88329315+fessehaeve@users.noreply.github.com> Date: Tue, 27 Feb 2024 15:43:59 +0100 Subject: [PATCH] fix crash caused by lacking null pointer, which is caused by using wrong cluster id (#32339) --- src/app/clusters/on-off-server/on-off-server.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/clusters/on-off-server/on-off-server.cpp b/src/app/clusters/on-off-server/on-off-server.cpp index ac1c4a0c3bf3c6..e4ba82bb8bdc2f 100644 --- a/src/app/clusters/on-off-server/on-off-server.cpp +++ b/src/app/clusters/on-off-server/on-off-server.cpp @@ -214,6 +214,7 @@ class DefaultOnOffSceneHandler : public scenes::DefaultSceneHandlerImpl ScenesManagement::ScenesServer::Instance().IsHandlerRegistered(endpoint, LevelControlServer::GetSceneHandler()))) #endif { + VerifyOrReturnError(mTransitionTimeInterface.sceneEventControl(endpoint) != nullptr, CHIP_ERROR_INVALID_ARGUMENT); OnOffServer::Instance().scheduleTimerCallbackMs(mTransitionTimeInterface.sceneEventControl(endpoint), timeMs); } @@ -221,7 +222,7 @@ class DefaultOnOffSceneHandler : public scenes::DefaultSceneHandlerImpl } private: - OnOffTransitionTimeInterface mTransitionTimeInterface = OnOffTransitionTimeInterface(Attributes::OnOff::Id, sceneOnOffCallback); + OnOffTransitionTimeInterface mTransitionTimeInterface = OnOffTransitionTimeInterface(OnOff::Id, sceneOnOffCallback); }; static DefaultOnOffSceneHandler sOnOffSceneHandler;