From 9e0234b7163514fc5ed10f3592bb631c1d36b3f0 Mon Sep 17 00:00:00 2001 From: Pontus Abrahamsson Date: Sun, 16 Jun 2024 09:04:34 +0200 Subject: [PATCH] Fix error --- apps/dashboard/src/actions/ai/storage.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/dashboard/src/actions/ai/storage.ts b/apps/dashboard/src/actions/ai/storage.ts index f677b78e6..fabf1d2cc 100644 --- a/apps/dashboard/src/actions/ai/storage.ts +++ b/apps/dashboard/src/actions/ai/storage.ts @@ -88,7 +88,9 @@ export async function getLatestChat() { } ); - return RedisClient.hgetall(chat.at(0)); + if (chat.at(0)) { + return RedisClient.hgetall(chat.at(0)); + } } catch (error) { return null; }