diff --git a/src/Util/Cache.php b/src/Util/Cache.php index 68abef59c4..a316bc9ac9 100644 --- a/src/Util/Cache.php +++ b/src/Util/Cache.php @@ -266,7 +266,7 @@ function ($file, $key, $iterator) { self::$cache = json_decode(file_get_contents(self::$path), true); // Verify the contents of the cache file. - if (self::$cache['config'] !== $configData) { + if (self::$cache === null || self::$cache['config'] !== $configData) { self::$cache = []; if (PHP_CODESNIFFER_VERBOSITY > 1) { echo "\t* cache was invalid and has been cleared *".PHP_EOL;