TT#15208 fix undef interval_lock variable check

* in certain cases $event->{interval_lock} may be undef
      and a check is added to prevent the script from exiting
      abnormally

Change-Id: I179d60efd796996db8dee280df6da2a3f1fa5b21
changes/36/12936/3
Kirill Solomko 9 years ago
parent 423698cca1
commit 6cab5bb0f2

@ -182,7 +182,7 @@ sub main {
$event->{id}),
'subscribers');
$event->{interval} = 'month';
if ($event->{interval_lock} > 0) {
if (defined $event->{interval_lock} && $event->{interval_lock} > 0) {
lock_customer($event, $subscribers);
}
eval {
@ -203,6 +203,10 @@ __END__
ngcp-fraud-auto-lock - checks for contract balances above fraud limit thresholds
=head1 SYNOPSIS
ngcp-fraud-daily-lock
=head1 OPTIONS
=over 8
@ -259,10 +263,12 @@ Development Team <support@sipwise.com>.
Kirill Solomko <ksolomko@sipwise.com>
=head1 LICENSE AND COPYRIGHT
=head1 COPYRIGHT
Copyright (C) 2016 Sipwise GmbH, Austria
=head1 LICENSE
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or

@ -182,7 +182,7 @@ sub main {
$event->{id}),
'subscribers');
$event->{interval} = 'day';
if ($event->{interval_lock} > 0) {
if (defined $event->{interval_lock} && $event->{interval_lock} > 0) {
lock_customer($event, $subscribers);
}
eval {
@ -203,6 +203,10 @@ __END__
ngcp-fraud-daily-lock - checks for contract balances above fraud limit thresholds
=head1 SYNOPSIS
ngcp-fraud-daily-lock
=head1 OPTIONS
=over 8
@ -259,10 +263,12 @@ Development Team <support@sipwise.com>.
Kirill Solomko <ksolomko@sipwise.com>
=head1 LICENSE AND COPYRIGHT
=head1 COPYRIGHT
Copyright (C) 2016 Sipwise GmbH, Austria
=head1 LICENSE
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or

Loading…
Cancel
Save