diff options
author | Angelo Naselli <anaselli@linux.it> | 2015-03-26 09:34:02 +0100 |
---|---|---|
committer | Angelo Naselli <anaselli@linux.it> | 2015-03-26 09:34:02 +0100 |
commit | 039adb66977dc7b3b9beace1680c602bf7ad67bb (patch) | |
tree | e72bb558befc059b640e0e59bdb7334e2aee5495 /lib | |
parent | 00b1450b4b523b327131fcce0cafe4de53ab9917 (diff) | |
download | colin-keep-039adb66977dc7b3b9beace1680c602bf7ad67bb.tar colin-keep-039adb66977dc7b3b9beace1680c602bf7ad67bb.tar.gz colin-keep-039adb66977dc7b3b9beace1680c602bf7ad67bb.tar.bz2 colin-keep-039adb66977dc7b3b9beace1680c602bf7ad67bb.tar.xz colin-keep-039adb66977dc7b3b9beace1680c602bf7ad67bb.zip |
Check also for an empty array to avoid type constraint failure in
ntp_program
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ManaTools/Shared/TimeZone.pm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/ManaTools/Shared/TimeZone.pm b/lib/ManaTools/Shared/TimeZone.pm index 544759a..9aa7ef2 100644 --- a/lib/ManaTools/Shared/TimeZone.pm +++ b/lib/ManaTools/Shared/TimeZone.pm @@ -152,10 +152,12 @@ has 'ntp_program' => ( sub _ntp_program_init { my $self = shift; + $DB::single = 1; + # looks for a running service from the configured ones, # if none is running chooses the first of the list my $list = $self->ntpServiceList(); - return "" if !$list; + return "" if !$list || scalar @{$list} == 0; my $ntpd = ""; my $isRunning = 0; |