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 | manatools-039adb66977dc7b3b9beace1680c602bf7ad67bb.tar manatools-039adb66977dc7b3b9beace1680c602bf7ad67bb.tar.gz manatools-039adb66977dc7b3b9beace1680c602bf7ad67bb.tar.bz2 manatools-039adb66977dc7b3b9beace1680c602bf7ad67bb.tar.xz manatools-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 544759a2..9aa7ef2f 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; |