Fix error on OTA update message without mapped device.

This commit is contained in:
Koen Kanters
2020-03-03 21:19:00 +01:00
parent 2d10c15a94
commit 3b60a907c8
+1 -1
View File
@@ -20,7 +20,7 @@ class OTAUpdate extends BaseExtension {
async onZigbeeEvent(type, data, mappedDevice, settingsDevice) {
if (data.type !== 'commandQueryNextImageRequest') return;
const supportsOTA = mappedDevice.hasOwnProperty('ota');
const supportsOTA = mappedDevice && mappedDevice.hasOwnProperty('ota');
if (supportsOTA) {
// When a device does a next image request, it will usually do it a few times after each other
// with only 10 - 60 seconds inbetween. It doesn' make sense to check for a new update