diff --git a/src/EditorconfigChecker/Cli/Cli.php b/src/EditorconfigChecker/Cli/Cli.php
index <HASH>..<HASH> 100644
--- a/src/EditorconfigChecker/Cli/Cli.php
+++ b/src/EditorconfigChecker/Cli/Cli.php
@@ -151,11 +151,12 @@ class Cli
                 $excludedPattern = [$options['e'], $options['exclude']];
             }
         }
-
-        if (is_array($excludedPattern)) {
-            $pattern = '/' . implode('|', $excludedPattern) . '/';
-        } else {
-            $pattern = '/' . $excludedPattern . '/';
+        if (isset($excludedPattern)) {
+            if (is_array($excludedPattern)) {
+                $pattern = '/' . implode('|', $excludedPattern) . '/';
+            } else {
+                $pattern = '/' . $excludedPattern . '/';
+            }
         }
 
         return $pattern;
BUGFIX: Fix behavior when no exclude is provided