Navigation Menu

Skip to content

Commit

Permalink
Avoid warning when item_price is called with a SKU rather than hashref
Browse files Browse the repository at this point in the history
Originally from a private repository commit:

Author: Jeff Boes <jeff@endpoint.com>
Date:   Wed Mar 24 09:20:20 2010 -0400

    This adds a minor sanity check to the code to avoid a warning when
    $item is not a reference (i.e., has been passed in as a SKU).
  • Loading branch information
jonjensen committed Apr 28, 2016
1 parent 85f8e9e commit a19a8b5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Vend/Data.pm
@@ -1,6 +1,6 @@
# Vend::Data - Interchange databases
#
# Copyright (C) 2002-2009 Interchange Development Group
# Copyright (C) 2002-2016 Interchange Development Group
# Copyright (C) 1996-2002 Red Hat, Inc.
#
# This program was originally based on Vend 0.2 and 0.3
Expand Down Expand Up @@ -1641,7 +1641,7 @@ sub item_price {
#::logDebug("item_price initial call: " . (ref $item ? $item->{code} : $item));

return $item->{mv_cache_price}
if ! $quantity and defined $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};
Expand Down

0 comments on commit a19a8b5

Please sign in to comment.