Skip to content

Commit

Permalink
[fix] cache get bug (#24)
Browse files Browse the repository at this point in the history
* [fix] cache get bug
  • Loading branch information
BrantBrown committed Aug 8, 2022
1 parent 07ee95a commit cbb8daa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export const queryWithCache = async <T>(
ttl?: number
) => {
const cacheItem = await cache.get<T>(cacheKey);
if (typeof cacheItem != undefined) {
if (cacheItem != undefined && cacheItem != null) {
console.debug(`hit cache key ${cacheKey}`, cacheItem);
return cacheItem;
}
Expand Down

0 comments on commit cbb8daa

Please sign in to comment.