Make processTransaction really handle not getting an object, by checking

to see if it's an object before calling methods on it.
This commit is contained in:
Colin Kuskie 2009-04-14 20:00:26 +00:00
parent ba156edb5a
commit 26ef39e66b
2 changed files with 9 additions and 5 deletions

View file

@ -13,6 +13,7 @@ use WebGUI::Macro;
use WebGUI::User;
use WebGUI::Shop::Cart;
use JSON;
use Scalar::Util qw/blessed/;
=head1 NAME
@ -616,11 +617,13 @@ sub processTransaction {
# determine object type
my $transaction;
my $paymentAddress;
if ($object->isa('WebGUI::Shop::Transaction')) {
$transaction = $object;
}
elsif ($object->isa('WebGUI::Shop::Address')) {
$paymentAddress = $object;
if (blessed $object) {
if ($object->isa('WebGUI::Shop::Transaction')) {
$transaction = $object;
}
elsif ($object->isa('WebGUI::Shop::Address')) {
$paymentAddress = $object;
}
}
# Setup dynamic transaction