diff --git a/lib/commonBindings.js b/lib/commonBindings.js index 0d0a224f..c2521f37 100644 --- a/lib/commonBindings.js +++ b/lib/commonBindings.js @@ -50,9 +50,11 @@ let context = { * @return {String} String identifier of the attribute type. */ function guessType(attribute, device) { - for (let i = 0; i < device.active.length; i++) { - if (device.active[i].name === attribute) { - return device.active[i].type; + if (device.active) { + for (let i = 0; i < device.active.length; i++) { + if (device.active[i].name === attribute) { + return device.active[i].type; + } } }