From 6cab5bb0f2da5660e5bae9b3b6ef6600e01ebae4 Mon Sep 17 00:00:00 2001 From: Kirill Solomko Date: Thu, 27 Apr 2017 15:12:29 +0200 Subject: [PATCH] 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 --- bin/ngcp-fraud-auto-lock | 10 ++++++++-- bin/ngcp-fraud-daily-lock | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/bin/ngcp-fraud-auto-lock b/bin/ngcp-fraud-auto-lock index de498ab..b13270a 100755 --- a/bin/ngcp-fraud-auto-lock +++ b/bin/ngcp-fraud-auto-lock @@ -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 . Kirill Solomko -=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 diff --git a/bin/ngcp-fraud-daily-lock b/bin/ngcp-fraud-daily-lock index cdb33be..2d73f2d 100755 --- a/bin/ngcp-fraud-daily-lock +++ b/bin/ngcp-fraud-daily-lock @@ -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 . Kirill Solomko -=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