Skip to content

Commit f97dc60

Browse files
committed
add c-kr#26
1 parent 8e3196c commit f97dc60

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

check_json.pl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,14 @@
139139
if ($np->opts->verbose) { (print Dumper ($json_response))};
140140

141141
my @attributes = split(',', $np->opts->attributes);
142-
my @warning = split(',', $np->opts->warning);
143-
my @critical = split(',', $np->opts->critical);
142+
my @warning;
143+
if ($np->opts->warning) {
144+
@warning = split(',', $np->opts->warning);
145+
}
146+
my @critical;
147+
if ($np->opts->critical) {
148+
@critical = split(',', $np->opts->critical);
149+
}
144150
my @divisor = $np->opts->divisor ? split(',',$np->opts->divisor) : () ;
145151
my %attributes = map { $attributes[$_] => { warning => $warning[$_] , critical => $critical[$_], divisor => ($divisor[$_] or 0) } } 0..$#attributes;
146152

0 commit comments

Comments
 (0)