mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2024-11-17 02:48:31 -07:00
Guard callbacks.
This commit is contained in:
parent
dc70840c8a
commit
189c0f360e
@ -248,7 +248,9 @@ class Zigbee {
|
|||||||
`failed with error ${error}`);
|
`failed with error ${error}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
callback(error, rsp);
|
if (callback) {
|
||||||
|
callback(error, rsp);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (cmdType === 'functional' && entity.functional) {
|
if (cmdType === 'functional' && entity.functional) {
|
||||||
@ -276,7 +278,9 @@ class Zigbee {
|
|||||||
logger.debug(`Successfully pinged ${ieeeAddr}`);
|
logger.debug(`Successfully pinged ${ieeeAddr}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
cb(error);
|
if (cb) {
|
||||||
|
cb(error);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
setTimeout(() => queueCallback(), delay);
|
setTimeout(() => queueCallback(), delay);
|
||||||
|
Loading…
Reference in New Issue
Block a user