From c7bcfa1c1850a6e6811a8152fd47da19af343633 Mon Sep 17 00:00:00 2001 From: bombies Date: Sat, 16 Sep 2023 12:29:43 -0500 Subject: [PATCH] Add a blank check for getting items from redis --- .../main/utils/database/mongodb/cache/redis/RedisCache.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/main/utils/database/mongodb/cache/redis/RedisCache.kt b/src/main/kotlin/main/utils/database/mongodb/cache/redis/RedisCache.kt index 0d1c8698..3b814e40 100644 --- a/src/main/kotlin/main/utils/database/mongodb/cache/redis/RedisCache.kt +++ b/src/main/kotlin/main/utils/database/mongodb/cache/redis/RedisCache.kt @@ -66,7 +66,8 @@ abstract class RedisCache protected constructor(cacheID: String) { } protected open suspend fun get(identifier: String): String? = coroutineScope { - return@coroutineScope jedis.get(cacheID + identifier) + val item = jedis.get(cacheID + identifier) + return@coroutineScope item.ifBlank { null } } protected open suspend fun get(identifier: Long): String? {