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 644c7df26a
commit 0440d7d632
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 {