Skip to content

Commit 7cf3f58

Browse files
granthonybenathomeofchampions
authored andcommitted
Fails if registry item is PHP-falsey (#536)
register() will throw an exception if sales_order_status_before is set to any PHP-falsey value -- boolean false, empty string, etc.
1 parent 05f223f commit 7cf3f58

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Observer/Sales/OrderSaveBefore.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function execute(\Magento\Framework\Event\Observer $observer)
5757
$orderStatus = $reloaded->getStatus();
5858
}
5959
//register the order status before change
60-
if (!$this->registry->registry('sales_order_status_before')) {
60+
if (is_null($this->registry->registry('sales_order_status_before'))) {
6161
$this->registry->register(
6262
'sales_order_status_before',
6363
$orderStatus

0 commit comments

Comments
 (0)