Skip to content

Commit 75a2cd0

Browse files
committed
Merge branch 'dev'
2 parents 5b230c4 + 5348912 commit 75a2cd0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/MiLight/CctPacketFormatter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ void CctPacketFormatter::finalizePacket(uint8_t* packet) {
4949

5050
void CctPacketFormatter::updateBrightness(uint8_t value) {
5151
const GroupState* state = this->stateStore->get(deviceId, groupId, MiLightRemoteType::REMOTE_TYPE_CCT);
52-
int8_t knownValue = state->isSetBrightness() ? state->getBrightness() : -1;
52+
int8_t knownValue = (state != NULL && state->isSetBrightness()) ? state->getBrightness() : -1;
5353

5454
valueByStepFunction(
5555
&PacketFormatter::increaseBrightness,
@@ -62,7 +62,7 @@ void CctPacketFormatter::updateBrightness(uint8_t value) {
6262

6363
void CctPacketFormatter::updateTemperature(uint8_t value) {
6464
const GroupState* state = this->stateStore->get(deviceId, groupId, MiLightRemoteType::REMOTE_TYPE_CCT);
65-
int8_t knownValue = state->isSetKelvin() ? state->getKelvin() : -1;
65+
int8_t knownValue = (state != NULL && state->isSetKelvin()) ? state->getKelvin() : -1;
6666

6767
valueByStepFunction(
6868
&PacketFormatter::increaseTemperature,

0 commit comments

Comments
 (0)