fix(mode): timeframe value should not be null (#2312)

The graylog API consider requests with undef parameters values as 0. So we'd better ensure that the timeframe value is valid when the option is set
This commit is contained in:
Thibault S 2020-10-30 15:27:38 +01:00 committed by GitHub
parent 9c65da1e92
commit 9a6a5c92a8
1 changed files with 5 additions and 0 deletions

View File

@ -65,6 +65,11 @@ sub check_options {
$self->{output}->add_option_msg(short_msg => 'Please set --query option.');
$self->{output}->option_exit();
}
if (defined($self->{option_results}->{timeframe}) && $self->{option_results}->{timeframe} eq '') {
$self->{output}->add_option_msg(short_msg => 'Please set --timeframe value.');
$self->{output}->option_exit();
}
}
sub manage_selection {