silence some uninitialized warnings
authorJason Etheridge <jason@esilibrary.com>
Thu, 1 Aug 2013 18:15:14 +0000 (14:15 -0400)
committerBill Erickson <berick@esilibrary.com>
Tue, 3 Sep 2013 18:41:56 +0000 (14:41 -0400)
Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Signed-off-by: Bill Erickson <berick@esilibrary.com>
src/perl/lib/OpenSRF/DomainObject/oilsMethod.pm
src/perl/lib/OpenSRF/Utils.pm

index a5a674f..4259ab3 100644 (file)
@@ -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;
index dc88d6a..61596d0 100644 (file)
@@ -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);
         }