We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d9a5e56 commit 16bcb7dCopy full SHA for 16bcb7d
Observer/Order/CreditmemoAfterSave.php
@@ -71,8 +71,8 @@ public function executeWhenEnabled(\Magento\Framework\Event\Observer $observer)
71
*/
72
protected function refundDiff($order)
73
{
74
- $oldData = $this->registry->registry(self::REGISTRY_KEY_ORDER_OLD_DATA);
75
- $oldValue = $this->connectHelper->priceAsCents($oldData['total_refunded']);
+ $oldData = $this->registry->registry(self::REGISTRY_KEY_ORDER_OLD_DATA) ?? [];
+ $oldValue = isset($oldData['total_refunded']) ? $this->connectHelper->priceAsCents($oldData['total_refunded']) : 0;
76
$newValue = $this->connectHelper->priceAsCents($order->getTotalRefunded());
77
78
return ($newValue - $oldValue);
0 commit comments