From 6c4cf1ddb53aed2cbdae955a2992042f618354f9 Mon Sep 17 00:00:00 2001 From: saubyk <39208279+saubyk@users.noreply.github.com> Date: Sun, 29 Aug 2021 21:40:23 -0400 Subject: [PATCH] hotfix for the optional lnrpcpath variable --- app.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app.js b/app.js index 94f7862..6049998 100644 --- a/app.js +++ b/app.js @@ -34,7 +34,8 @@ if (typeof global.REST_PLUGIN_CONFIG === 'undefined') { global.logger = configLogger(global.config); //LN_PATH is the path containing lightning-rpc file -global.ln = require('./lightning-client-js')(global.config.LNRPCPATH.trim() || process.env.LN_PATH); +let lnpath = (global.config.LNRPCPATH && global.config.LNRPCPATH.trim() !== '') ? global.config.LNRPCPATH.trim() : process.env.LN_PATH; +global.ln = require('./lightning-client-js')(lnpath); app.use(bodyparser.json()); app.use(bodyparser.urlencoded({ extended: false })); app.use((req, res, next) => {