Skip to content

Commit 439e4f3

Browse files
committed
Fix issue #166: Null reference error
1 parent f7bdc89 commit 439e4f3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/checks.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,10 @@ var commands = module.exports = {
191191
var cmd = /\ [^-].*/.exec(args);
192192
if (cmd != null) {
193193
var options = args.substring(0, cmd.index).match(/--\w+/g);
194-
if (!options.reduce((valid, item) => valid &&
195-
(allowedoptions.indexOf(item) > -1), true)) return ['invalid_format'];
196-
197194
if (options != null) {
195+
if (!options.reduce((valid, item) => valid &&
196+
(allowedoptions.indexOf(item) > -1), true)) return ['invalid_format'];
197+
198198
var optparams = args.substring(0, cmd.index).match(/--\w+=\d+\w*/g);
199199
return ((optparams != null) && (optparams.length == options.length)) ?
200200
[] : ['healthcheck_options_missing_args'];

0 commit comments

Comments
 (0)