diff --git a/app/code/core/Mage/SalesRule/Model/Observer.php b/app/code/core/Mage/SalesRule/Model/Observer.php index e8523a6ddc0..0db443e6dd3 100644 --- a/app/code/core/Mage/SalesRule/Model/Observer.php +++ b/app/code/core/Mage/SalesRule/Model/Observer.php @@ -159,7 +159,8 @@ public function sales_order_paymentCancel($observer) Mage::getResourceModel('salesrule/coupon_usage')->updateCustomerCouponTimesUsed($customerId, $coupon->getId(), true); // Decrement rule times_used - if ($customerCoupon = Mage::getModel('salesrule/rule_customer')->loadByCustomerRule($customerId, $coupon->getRuleId())) { + $customerCoupon = Mage::getModel('salesrule/rule_customer')->loadByCustomerRule($customerId, $coupon->getRuleId()); + if ($customerCoupon->getId()) { $customerCoupon->setTimesUsed($customerCoupon->getTimesUsed() - 1); $customerCoupon->save(); }