message: Fixed crash when components are set to {}
diff: @@ -554,6 +554,7 @@ Gateway.prototype.valueTopic = function (node, valueId, returnObject) {
  }
  Gateway.prototype.publishDiscovery = function (hassDevice, nodeId, deleteDevice, update) {
  + try {
  // set values as discovered
  for (let k = 0; k < hassDevice.values.length; k++) {
  this.discovered[nodeId + '-' + hassDevice.values[k]] = hassDevice
  @@ -573,6 +574,9 @@ Gateway.prototype.publishDiscovery = function (hassDevice, nodeId, deleteDevice,
  if (update) {
  this.zwave.updateDevice(hassDevice, nodeId, deleteDevice)
  }
  + } catch (error) {
  + debug('Error while publishing node %d: %s', nodeId, error.message)
  + }
  }
  Gateway.prototype.rediscoverAll = function () {
  