From dcd69538156ac99b04505938ef132bf5347cfc2f Mon Sep 17 00:00:00 2001 From: Abner Tudtud <114082473+enjinabner@users.noreply.github.com> Date: Mon, 18 Nov 2024 07:57:27 +0800 Subject: [PATCH] [PLA-2080] Check for empty values (#112) --- src/Support/ClaimProbabilities.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Support/ClaimProbabilities.php b/src/Support/ClaimProbabilities.php index ba86639..69b3950 100644 --- a/src/Support/ClaimProbabilities.php +++ b/src/Support/ClaimProbabilities.php @@ -50,9 +50,9 @@ public static function getCacheKey(string $code): string /** * Get the probabilities for a code. */ - public static function getProbabilities(string $code): array + public static function getProbabilities(?string $code): array { - return Cache::get( + return empty($code) ? [] : Cache::get( static::getCacheKey($code), static::getProbabilitiesFromDB($code) );