From 3944f87c6d758c5c6f4a83451d41d49802f3128e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alu=C3=ADsio=20Amaral?= Date: Tue, 6 Mar 2018 11:13:52 -0300 Subject: [PATCH] throw error when using queried place-before, place-after and etc --- package.json | 4 ++-- src/RosApiCrud.ts | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 17cabec..74546b6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "routeros-client", - "version": "0.7.0", + "version": "0.8.0", "description": "Easy to use abstraction layer over the node-routeros API", "main": "./dist/index", "types": "./dist/index", @@ -51,6 +51,6 @@ }, "dependencies": { "debug": "^3.*", - "node-routeros": "^1.3.3" + "node-routeros": "^1.*" } } diff --git a/src/RosApiCrud.ts b/src/RosApiCrud.ts index c32dc22..2513eeb 100644 --- a/src/RosApiCrud.ts +++ b/src/RosApiCrud.ts @@ -348,6 +348,7 @@ export abstract class RouterOSAPICrud { return Promise.all(promises).then((results) => { for (let result of results) { if (Array.isArray(result)) result = result.shift(); + if (!result) return Promise.reject(new RosException("REFNOTFND")); const consulted = consultedIndexes.shift(); if (consulted.key === "place-after") { this.placeAfter = result[".id"];