diff --git a/packages/CodeQuality/src/Rector/Foreach_/SimplifyForeachToArrayFilterRector.php b/packages/CodeQuality/src/Rector/Foreach_/SimplifyForeachToArrayFilterRector.php
index <HASH>..<HASH> 100644
--- a/packages/CodeQuality/src/Rector/Foreach_/SimplifyForeachToArrayFilterRector.php
+++ b/packages/CodeQuality/src/Rector/Foreach_/SimplifyForeachToArrayFilterRector.php
@@ -117,7 +117,7 @@ PHP
         /** @var If_ $ifNode */
         $ifNode = $foreachNode->stmts[0];
 
-        if ($ifNode->else) {
+        if ($ifNode->else !== null) {
             return true;
         }
fixup! Fix else in SimplifyForeachToArrayFilterRector