mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-03-08 21:02:56 +00:00
Fix NPE for smartsense multi
There was a common NPE caused by assuming there would be additional attributes reported with one acceleration value. This corrects it to instead properly handle the case where there weren't additional attributes. This resolves: https://smartthings.atlassian.net/browse/DVCSMP-2668
This commit is contained in:
@@ -178,7 +178,7 @@ private List<Map> handleAcceleration(descMap) {
|
||||
result += parseAxis(descMap.additionalAttrs)
|
||||
}
|
||||
} else if (descMap.clusterInt == 0xFC02 && descMap.attrInt == 0x0012) {
|
||||
def addAttrs = descMap.additionalAttrs
|
||||
def addAttrs = descMap.additionalAttrs ?: []
|
||||
addAttrs << ["attrInt": descMap.attrInt, "value": descMap.value]
|
||||
result += parseAxis(addAttrs)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user