From 8f7e38f3b762ce830224c985a16847474fe23aac Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 18 Jul 2014 09:14:07 -0400 Subject: [PATCH] Bug 12487 [QA Followup] - GetContract must return undef with no params Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi --- C4/Contract.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/C4/Contract.pm b/C4/Contract.pm index 57978a042e..4afd670dcc 100644 --- a/C4/Contract.pm +++ b/C4/Contract.pm @@ -92,7 +92,7 @@ sub GetContracts { =head2 GetContract -$contract = GetContract( { contractnumber => $contractnumber } ); +$contract = GetContract( { contractnumber => $contractnumber } ); Looks up the contract that has PRIMKEY (contractnumber) value $contractID @@ -104,6 +104,8 @@ sub GetContract { my ($params) = @_; my $contractnumber = $params->{contractnumber}; + return unless $contractnumber; + my $contracts = GetContracts({ contractnumber => $contractnumber, }); -- 2.39.2