diff --git a/vendor/magento/module-catalog-rule/Model/Rule/Condition/Product.php b/vendor/magento/module-catalog-rule/Model/Rule/Condition/Product.php
index 0db178b2a0a6d..4927dcc3dcfaa 100644
--- a/vendor/magento/module-catalog-rule/Model/Rule/Condition/Product.php
+++ b/vendor/magento/module-catalog-rule/Model/Rule/Condition/Product.php
@@ -27,16 +27,20 @@ public function validate(\Magento\Framework\Model\AbstractModel $model)
         }
 
         $oldAttrValue = $model->getData($attrCode);
-        if ($oldAttrValue === null) {
+
+        $this->_setAttributeValue($model);
+
+        $attrValue = $model->getData($attrCode);
+        if ($attrValue === null) {
             if ($this->getOperator() === '<=>') {
+                $this->_restoreOldAttrValue($model, $oldAttrValue);
                 return true;
             }
+            $this->_restoreOldAttrValue($model, $oldAttrValue);
             return false;
         }
 
-        $this->_setAttributeValue($model);
-
-        $result = $this->validateAttribute($model->getData($attrCode));
+        $result = $this->validateAttribute($attrValue);
         $this->_restoreOldAttrValue($model, $oldAttrValue);
 
         return (bool)$result;
