We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f3ef164 commit 79f612cCopy full SHA for 79f612c
src/lib/device-cache.ts
@@ -38,7 +38,9 @@ export async function getDevicesAndBrowsers(
38
if (Date.now() - stats.mtimeMs < TTL_MS) {
39
try {
40
cache = JSON.parse(fs.readFileSync(CACHE_FILE, "utf8"));
41
- return cache[type];
+ if (cache[type]) {
42
+ return cache[type];
43
+ }
44
} catch (error) {
45
console.error("Error parsing cache file:", error);
46
// Continue with fetching fresh data
0 commit comments