From 2c2d75ae37c5b7c0f5ea3c94c88033908b831a49 Mon Sep 17 00:00:00 2001 From: jackchi Date: Mon, 10 Oct 2016 09:02:59 -0700 Subject: [PATCH] [DVCSMP-2117] Fix NPE for unknown descriptions in parse --- .../smartthings/smartpower-outlet.src/smartpower-outlet.groovy | 2 +- devicetypes/smartthings/zigbee-dimmer.src/zigbee-dimmer.groovy | 2 +- .../smartthings/zigbee-rgbw-bulb.src/zigbee-rgbw-bulb.groovy | 2 +- .../zigbee-white-color-temperature-bulb.groovy | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/devicetypes/smartthings/smartpower-outlet.src/smartpower-outlet.groovy b/devicetypes/smartthings/smartpower-outlet.src/smartpower-outlet.groovy index 7b74969..ec7cdad 100644 --- a/devicetypes/smartthings/smartpower-outlet.src/smartpower-outlet.groovy +++ b/devicetypes/smartthings/smartpower-outlet.src/smartpower-outlet.groovy @@ -106,7 +106,7 @@ def parse(String description) { else { def cluster = zigbee.parse(description) - if (cluster.clusterId == 0x0006 && cluster.command == 0x07){ + if (cluster && cluster.clusterId == 0x0006 && cluster.command == 0x07){ if (cluster.data[0] == 0x00) { log.debug "ON/OFF REPORTING CONFIG RESPONSE: " + cluster sendEvent(name: "checkInterval", value: 60 * 12, displayed: false, data: [protocol: "zigbee", hubHardwareId: device.hub.hardwareID]) diff --git a/devicetypes/smartthings/zigbee-dimmer.src/zigbee-dimmer.groovy b/devicetypes/smartthings/zigbee-dimmer.src/zigbee-dimmer.groovy index a7c902f..b0239e6 100644 --- a/devicetypes/smartthings/zigbee-dimmer.src/zigbee-dimmer.groovy +++ b/devicetypes/smartthings/zigbee-dimmer.src/zigbee-dimmer.groovy @@ -62,7 +62,7 @@ def parse(String description) { else { def cluster = zigbee.parse(description) - if (cluster.clusterId == 0x0006 && cluster.command == 0x07) { + if (cluster && cluster.clusterId == 0x0006 && cluster.command == 0x07) { if (cluster.data[0] == 0x00) { log.debug "ON/OFF REPORTING CONFIG RESPONSE: " + cluster sendEvent(name: "checkInterval", value: 60 * 12, displayed: false, data: [protocol: "zigbee", hubHardwareId: device.hub.hardwareID]) diff --git a/devicetypes/smartthings/zigbee-rgbw-bulb.src/zigbee-rgbw-bulb.groovy b/devicetypes/smartthings/zigbee-rgbw-bulb.src/zigbee-rgbw-bulb.groovy index 4f7c791..343570c 100644 --- a/devicetypes/smartthings/zigbee-rgbw-bulb.src/zigbee-rgbw-bulb.groovy +++ b/devicetypes/smartthings/zigbee-rgbw-bulb.src/zigbee-rgbw-bulb.groovy @@ -107,7 +107,7 @@ def parse(String description) { sendEvent(name: "saturation", value: saturationValue, descriptionText: "Color has changed", displayed: false) } } - else if (cluster.clusterId == 0x0006 && cluster.command == 0x07) { + else if (cluster && cluster.clusterId == 0x0006 && cluster.command == 0x07) { if (cluster.data[0] == 0x00){ log.debug "ON/OFF REPORTING CONFIG RESPONSE: " + cluster sendEvent(name: "checkInterval", value: 60 * 12, displayed: false, data: [protocol: "zigbee", hubHardwareId: device.hub.hardwareID]) diff --git a/devicetypes/smartthings/zigbee-white-color-temperature-bulb.src/zigbee-white-color-temperature-bulb.groovy b/devicetypes/smartthings/zigbee-white-color-temperature-bulb.src/zigbee-white-color-temperature-bulb.groovy index b729df7..8a210f2 100644 --- a/devicetypes/smartthings/zigbee-white-color-temperature-bulb.src/zigbee-white-color-temperature-bulb.groovy +++ b/devicetypes/smartthings/zigbee-white-color-temperature-bulb.src/zigbee-white-color-temperature-bulb.groovy @@ -85,7 +85,7 @@ def parse(String description) { else { def cluster = zigbee.parse(description) - if (cluster.clusterId == 0x0006 && cluster.command == 0x07) { + if (cluster && cluster.clusterId == 0x0006 && cluster.command == 0x07) { if (cluster.data[0] == 0x00) { log.debug "ON/OFF REPORTING CONFIG RESPONSE: " + cluster sendEvent(name: "checkInterval", value: 60 * 12, displayed: false, data: [protocol: "zigbee", hubHardwareId: device.hub.hardwareID])