From 302fea713ac8dd0874eba58a2a50307aa06a1218 Mon Sep 17 00:00:00 2001 From: Lars Moelleken Date: Thu, 26 Nov 2020 00:39:21 +0100 Subject: [PATCH] Cache: Fix PHP Notice https://github.com/squizlabs/PHP_CodeSniffer/issues/3173 --- src/Util/Cache.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;