Add extra check for empty results in discovery (#304)

This commit is contained in:
Ben Hardill 2017-04-19 15:21:05 +01:00 committed by Dave Conway-Jones
parent d48644e16a
commit 6168f7ef34
2 changed files with 2 additions and 2 deletions

View File

@ -123,7 +123,7 @@ WeMoNG.prototype.start = function start() {
request.get(location.href, function(err, res, xml) {
if (!err) {
xml2js.parseString(xml, function(err, json) {
if (!err && json) {
if (!err && json && json.root) {
var device = { ip: location.hostname, port: location.port };
for (var key in json.root.device[0]) {
device[key] = json.root.device[0][key][0];

View File

@ -1,6 +1,6 @@
{
"name": "node-red-node-wemo",
"version": "0.1.11",
"version": "0.1.12",
"description": "Input and Output nodes for Belkin WeMo devices",
"repository": "https://github.com/node-red/node-red-nodes/tree/master/hardware",
"main": "WeMoNG.js",