From 4f30e775f5cdcaf1f48114908ee00d765fb976ea Mon Sep 17 00:00:00 2001 From: atanasster Date: Sat, 6 Jun 2020 12:43:06 -0400 Subject: [PATCH] fix: account for docs without stories --- ui/blocks/src/context/block/BlockContext.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/blocks/src/context/block/BlockContext.tsx b/ui/blocks/src/context/block/BlockContext.tsx index 54dd7a46a..6e46d4e99 100644 --- a/ui/blocks/src/context/block/BlockContext.tsx +++ b/ui/blocks/src/context/block/BlockContext.tsx @@ -61,7 +61,8 @@ export const BlockContextProvider: React.FC = ({ const docId = storyId || propsDocId ? propsDocId : store.firstDoc; if (!storyId && docId) { const doc = store.getStoryDoc(docId); - storyId = doc && doc.stories.length ? doc.stories[0] : undefined; + storyId = + doc && doc.stories && doc.stories.length ? doc.stories[0] : undefined; } return (