From: Jason Etheridge Date: Thu, 1 Aug 2013 18:15:14 +0000 (-0400) Subject: silence some uninitialized warnings X-Git-Tag: osrf_rel_2_3_0-beta~44 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=e4a6a624ff3c8cbcc33c0b6f27f65c2a51c5471c;p=OpenSRF.git silence some uninitialized warnings Signed-off-by: Jason Etheridge Signed-off-by: Bill Erickson --- diff --git a/src/perl/lib/OpenSRF/DomainObject/oilsMethod.pm b/src/perl/lib/OpenSRF/DomainObject/oilsMethod.pm index a5a674f..4259ab3 100644 --- a/src/perl/lib/OpenSRF/DomainObject/oilsMethod.pm +++ b/src/perl/lib/OpenSRF/DomainObject/oilsMethod.pm @@ -91,7 +91,11 @@ sub params { my $self = shift; my @args = @_; $self->{params} = \@args if (@args); - return @{ $self->{params} }; + if ($self->{params}) { + return @{ $self->{params} }; + } else { + return (); + } } 1; diff --git a/src/perl/lib/OpenSRF/Utils.pm b/src/perl/lib/OpenSRF/Utils.pm index dc88d6a..61596d0 100644 --- a/src/perl/lib/OpenSRF/Utils.pm +++ b/src/perl/lib/OpenSRF/Utils.pm @@ -265,7 +265,7 @@ sub interval_to_seconds { $amount += 60 * $count if ($type =~ /^m(?!o)/oi); $amount += 60 * 60 * $count if ($type =~ /^h/); $amount += 60 * 60 * 24 * $count if ($type =~ /^d/oi); - $amount += 60 * 60 * 24 * 7 * $count if ($2 =~ /^w/oi); + $amount += 60 * 60 * 24 * 7 * $count if (defined $2 && $2 =~ /^w/oi); $amount += ((60 * 60 * 24 * 365)/12) * $count if ($type =~ /^mo/io); $amount += 60 * 60 * 24 * 365 * $count if ($type =~ /^y/oi); }