[interchange] Fix code which assumes we already have a hashref
David Christensen <[email protected]> Mon, 07 Nov 2016 19:32:52 +0000
| Newsgroups | gmane.comp.web.interchange.cvs |
|---|---|
| Message-ID | <[email protected]> |
commit 847ef1d1856cf121b4b09c9fcf6170f7310048bc Author: David Christensen <[email protected]> Date: Mon Nov 7 13:32:47 2016 -0600 Fix code which assumes we already have a hashref lib/Vend/Data.pm | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) --- diff --git a/lib/Vend/Data.pm b/lib/Vend/Data.pm index 5313f72..edeac3c 100644 --- a/lib/Vend/Data.pm +++ b/lib/Vend/Data.pm @@ -1643,10 +1643,11 @@ sub item_price { #::logDebug("item_price initial call: " . (ref $item ? $item->{code} : $item)); + $item = { 'code' => $item } unless ref $item; + return $item->{mv_cache_price} if ! $quantity and ref($item) and defined $item->{mv_cache_price}; - $item = { 'code' => $item } unless ref $item; $item->{quantity} = 1 if ! defined $item->{quantity}; if( ! $item->{mv_ib}