From 4657de64704ced797aafe7e861bc2333d9bc32f7 Mon Sep 17 00:00:00 2001 From: Linden <65407488+thelindat@users.noreply.github.com> Date: Sun, 18 Sep 2022 22:53:04 +1000 Subject: [PATCH] fix(package/cache): check if cached value is defined --- package/shared/resource/cache/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/shared/resource/cache/index.ts b/package/shared/resource/cache/index.ts index acf0a6fed..743ef77bf 100644 --- a/package/shared/resource/cache/index.ts +++ b/package/shared/resource/cache/index.ts @@ -5,13 +5,13 @@ export const cache: Record = new Proxy( { get(target, key: string) { const result = key ? target[key] : target; - if (result) return result; + if (result !== undefined) return result; AddEventHandler(`ox_lib:cache:${key}`, (value: any) => { target[key] = value; }); - target[key] = exports.ox_lib.cache(key); + target[key] = exports.ox_lib.cache(key) || false; return target[key]; }, }