From cff0a383a46b82e24bb014dfd248e7caeff5046f Mon Sep 17 00:00:00 2001 From: Rafostar <40623528+Rafostar@users.noreply.github.com> Date: Sat, 14 Sep 2019 17:25:57 +0200 Subject: [PATCH] Remove first devices array element after length check --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 1fcf4c8..264a93c 100644 --- a/index.js +++ b/index.js @@ -96,10 +96,11 @@ module.exports = class Client { var devicesObject = {}; var outArray = outStr.split('device #'); - outArray.shift(); if(outArray.length > 1) { + outArray.shift(); + outArray.forEach(device => { var devName = device.substring(device.indexOf(':') + 2, device.indexOf('\n'));