From 3c6dba6070829d5085b97ca5c438c17d12946274 Mon Sep 17 00:00:00 2001 From: Kirill Solomko Date: Wed, 2 Aug 2017 02:38:54 +0200 Subject: [PATCH] TT#19459 check for undefined CF sourceset mode * CF source set is optional, in this case its value should be default to 'whitelist' Change-Id: If521c5ebf361ff22f5c491f4cfd7e26fad5476d8 --- lib/NGCP/Panel/Role/API/CallForwards.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/NGCP/Panel/Role/API/CallForwards.pm b/lib/NGCP/Panel/Role/API/CallForwards.pm index 1f4096caa9..aa48aeb2d9 100644 --- a/lib/NGCP/Panel/Role/API/CallForwards.pm +++ b/lib/NGCP/Panel/Role/API/CallForwards.pm @@ -327,6 +327,7 @@ sub _contents_from_cfm { my $timeset_item = $cfm_item->time_set; my $dset_item = $cfm_item->destination_set; my $sourceset_item = $cfm_item->source_set; + my $sourceset_mode = $sourceset_item ? $sourceset_item->mode : 'whitelist'; for my $time ($timeset_item ? $timeset_item->voip_cf_periods->all : () ) { push @times, {$time->get_inflated_columns}; delete @{$times[-1]}{'time_set_id', 'id'}; @@ -349,7 +350,7 @@ sub _contents_from_cfm { delete @{$sources[-1]}{'source_set_id', 'id'}; } return {times => \@times, destinations => \@destinations, - sources => \@sources, sources_mode => $sourceset_item->mode}; + sources => \@sources, sources_mode => $sourceset_mode}; } 1;