From a6958e1451639d1151a5726050192fc4deca298c Mon Sep 17 00:00:00 2001 From: liamcottle Date: Wed, 27 Mar 2024 01:32:08 +1300 Subject: [PATCH] options are null when not provided --- src/mqtt.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mqtt.js b/src/mqtt.js index 6b473a1..dd2b3e6 100644 --- a/src/mqtt.js +++ b/src/mqtt.js @@ -32,9 +32,9 @@ const options = commandLineArgs([ ]); // get options and fallback to default values -const mqttBrokerUrl = options["mqtt-broker-url"] || "mqtt://mqtt.meshtastic.org"; -const mqttUsername = options["mqtt-username"] || "meshdev"; -const mqttPassword = options["mqtt-password"] || "large4cats"; +const mqttBrokerUrl = options["mqtt-broker-url"] ?? "mqtt://mqtt.meshtastic.org"; +const mqttUsername = options["mqtt-username"] ?? "meshdev"; +const mqttPassword = options["mqtt-password"] ?? "large4cats"; const collectServiceEnvelopes = options["collect-service-envelopes"] ?? false; // create mqtt client