From e4a6a624ff3c8cbcc33c0b6f27f65c2a51c5471c Mon Sep 17 00:00:00 2001 From: Jason Etheridge Date: Thu, 1 Aug 2013 14:15:14 -0400 Subject: [PATCH] silence some uninitialized warnings Signed-off-by: Jason Etheridge Signed-off-by: Bill Erickson --- src/perl/lib/OpenSRF/DomainObject/oilsMethod.pm | 6 +++++- src/perl/lib/OpenSRF/Utils.pm | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) 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); } -- 2.11.0