Bug 15466: Do not assume $values_in is a hashref
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 5 Jan 2016 09:39:32 +0000 (09:39 +0000)
committerBrendan A Gallagher <brendan@bywatersolutions.com>
Thu, 7 Jan 2016 19:21:41 +0000 (19:21 +0000)
It could be undefined.
Test plan:
prove t/db_dependent/Suggestions.t
should return green.

Signed-off-by: Marc VĂ©ron <veron@veron.ch>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
C4/Letters.pm

index e5c15ba..dc9574f 100644 (file)
@@ -803,7 +803,7 @@ sub _parseletter {
 
     # Work on a local copy of $values_in (passed by reference) to avoid side effects
     # in callers ( by changing / formatting values )
-    my $values = { %$values_in };
+    my $values = $values_in ? { %$values_in } : {};
 
     if ( $table eq 'borrowers' && $values->{'dateexpiry'} ){
         $values->{'dateexpiry'} = format_sqldatetime( $values->{'dateexpiry'} );