Skip to content

Commit 5dc05bb

Browse files
Hopefully don't crash
1 parent 74e8342 commit 5dc05bb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/sources/cachingSource.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ type CacheOptions = Omit<Options, "url"> & {
1111

1212
const getShouldCache = async (layer: { name: string }) => {
1313
const store = await getCurrentSettings();
14-
return store.layers[layer.name].cache;
14+
return store.layers?.[layer.name]?.cache ?? false;
1515
}
1616

1717
export const getCacheId = (props: { name }, tile: TileCoord) => `${props.name}/${tile[2]}/${tile[0]}/${tile[1]}`;

0 commit comments

Comments
 (0)