fix: some blocks don't have value attribute

This commit is contained in:
Ernie Hsiung
2020-11-11 23:11:56 -05:00
parent 0503246af6
commit 1260510720

View File

@@ -52,7 +52,7 @@ export async function pageRoute(req: HandlerRequest) {
const pendingCollections = allBlockKeys.flatMap((blockId) => {
const block = allBlocks[blockId];
return block.value.type === "collection_view" ? [block.value.id] : [];
return (block.value && block.value.type === "collection_view") ? [block.value.id] : [];
});
for (let b of pendingCollections) {