From 0b5a867bc7f7aab5733c42692d5f9110a38cd31f Mon Sep 17 00:00:00 2001 From: Abel Hoogeveen Date: Wed, 24 Nov 2021 12:37:51 +0100 Subject: [PATCH] Small bugfix. - Added a small fix that suppresses warnings when no cache data exists. --- src/FuzeWorks/ObjectStorage/ObjectStorageCache.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FuzeWorks/ObjectStorage/ObjectStorageCache.php b/src/FuzeWorks/ObjectStorage/ObjectStorageCache.php index e4822f2..02e59ae 100644 --- a/src/FuzeWorks/ObjectStorage/ObjectStorageCache.php +++ b/src/FuzeWorks/ObjectStorage/ObjectStorageCache.php @@ -49,7 +49,7 @@ class ObjectStorageCache implements CacheInterface private function testTTL(string $key) { $meta = $this->provider->getItemMeta('fwcache_' . $key); - if ($meta['ttl'] > 0 && time() > $meta['time'] + $meta['ttl']) + if (!is_null($meta) && $meta['ttl'] > 0 && time() > $meta['time'] + $meta['ttl']) $this->provider->deleteItem('fwcache_' . $key); }