Skip to content

Commit

Permalink
Fixed error when payment methods have been deleted (#2772)
Browse files Browse the repository at this point in the history
  • Loading branch information
sreichel authored Dec 2, 2022
1 parent 569dfe4 commit f835cb6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/code/core/Mage/Payment/Model/Observer.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function salesOrderBeforeSave($observer)
/** @var Mage_Sales_Model_Order $order */
$order = $observer->getEvent()->getOrder();

if ($order->getPayment()->getMethodInstance()->getCode() != 'free') {
if ($order->getPayment() && $order->getPayment()->getMethodInstance()->getCode() != 'free') {
return $this;
}

Expand Down

0 comments on commit f835cb6

Please sign in to comment.