From e0e4f161bb32eddd04d1d6c2e6666d6c696d2dad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laurent=20VERDO=C3=8FA?= Date: Thu, 29 Jul 2021 10:51:05 +0200 Subject: [PATCH] Fix issue #156: Null reference error --- lib/checks.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/checks.js b/lib/checks.js index 40e6ffa..db7c0d9 100644 --- a/lib/checks.js +++ b/lib/checks.js @@ -191,10 +191,10 @@ var commands = module.exports = { var cmd = /\ [^-].*/.exec(args); if (cmd != null) { var options = args.substring(0, cmd.index).match(/--\w+/g); - if (!options.reduce((valid, item) => valid && - (allowedoptions.indexOf(item) > -1), true)) return ['invalid_format']; - if (options != null) { + if (!options.reduce((valid, item) => valid && + (allowedoptions.indexOf(item) > -1), true)) return ['invalid_format']; + var optparams = args.substring(0, cmd.index).match(/--\w+=\d+\w*/g); return ((optparams != null) && (optparams.length == options.length)) ? [] : ['healthcheck_options_missing_args'];