From b2d76bc60a891d0f637b5f58ef81b4d41ca679c2 Mon Sep 17 00:00:00 2001 From: Matt Visnovsky Date: Wed, 5 Jun 2024 15:39:55 -0600 Subject: [PATCH] Refactor line for conciseness --- server/monitor-types/snmp.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/server/monitor-types/snmp.js b/server/monitor-types/snmp.js index 0964acce6..7c454ab68 100644 --- a/server/monitor-types/snmp.js +++ b/server/monitor-types/snmp.js @@ -29,11 +29,7 @@ class SNMPMonitorType extends MonitorType { const varbinds = await new Promise((resolve, reject) => { session.get([ monitor.snmpOid ], (error, varbinds) => { - if (error) { - reject(error); - } else { - resolve(varbinds); - } + error ? reject(error) : resolve(varbinds); }); }); log.debug("monitor", `SNMP: Received varbinds (Type: ${snmp.ObjectType[varbinds[0].type]} Value: ${varbinds[0].value}`);