From 46b1cfb1fb0428b5c7c54883bf61bf04647fb7c4 Mon Sep 17 00:00:00 2001 From: lukinovec Date: Wed, 11 Jan 2023 08:18:22 +0100 Subject: [PATCH] Check if cached tenant is truthy --- src/Resolvers/Contracts/CachedTenantResolver.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Resolvers/Contracts/CachedTenantResolver.php b/src/Resolvers/Contracts/CachedTenantResolver.php index d1d8a7c3..13a1f6b1 100644 --- a/src/Resolvers/Contracts/CachedTenantResolver.php +++ b/src/Resolvers/Contracts/CachedTenantResolver.php @@ -27,8 +27,7 @@ abstract class CachedTenantResolver implements TenantResolver $key = $this->getCacheKey(...$args); - $tenant = $this->cache->has($key) ? $this->cache->get($key) : null; - if ($tenant) { + if ($tenant = $this->cache->get($key)) { $this->resolved($tenant, ...$args); return $tenant;