Skip to content

Commit 6d8613d

Browse files
authoredFeb 27, 2024
fix crash caused by lacking null pointer, which is caused by using wrong cluster id (#32339)
1 parent 8428564 commit 6d8613d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎src/app/clusters/on-off-server/on-off-server.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -214,14 +214,15 @@ class DefaultOnOffSceneHandler : public scenes::DefaultSceneHandlerImpl
214214
ScenesManagement::ScenesServer::Instance().IsHandlerRegistered(endpoint, LevelControlServer::GetSceneHandler())))
215215
#endif
216216
{
217+
VerifyOrReturnError(mTransitionTimeInterface.sceneEventControl(endpoint) != nullptr, CHIP_ERROR_INVALID_ARGUMENT);
217218
OnOffServer::Instance().scheduleTimerCallbackMs(mTransitionTimeInterface.sceneEventControl(endpoint), timeMs);
218219
}
219220

220221
return CHIP_NO_ERROR;
221222
}
222223

223224
private:
224-
OnOffTransitionTimeInterface mTransitionTimeInterface = OnOffTransitionTimeInterface(Attributes::OnOff::Id, sceneOnOffCallback);
225+
OnOffTransitionTimeInterface mTransitionTimeInterface = OnOffTransitionTimeInterface(OnOff::Id, sceneOnOffCallback);
225226
};
226227
static DefaultOnOffSceneHandler sOnOffSceneHandler;
227228

0 commit comments

Comments
 (0)