Fix possible exception when irreceive is not initialised

Fix possible exception when irreceive is not initialised
This commit is contained in:
Theo Arends 2019-07-08 12:24:31 +02:00
parent 56383d3758
commit e67b27b0a3

View File

@ -118,8 +118,10 @@ unsigned long ir_lasttime = 0;
void IrReceiveUpdateThreshold()
{
if (Settings.param[P_IR_UNKNOW_THRESHOLD] < 6) { Settings.param[P_IR_UNKNOW_THRESHOLD] = 6; }
irrecv->setUnknownThreshold(Settings.param[P_IR_UNKNOW_THRESHOLD]);
if (irrecv != nullptr) {
if (Settings.param[P_IR_UNKNOW_THRESHOLD] < 6) { Settings.param[P_IR_UNKNOW_THRESHOLD] = 6; }
irrecv->setUnknownThreshold(Settings.param[P_IR_UNKNOW_THRESHOLD]);
}
}
void IrReceiveInit(void)