Skip to content

Commit

Permalink
fix: account for docs without stories
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed Jun 6, 2020
1 parent 33f5585 commit 4f30e77
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ui/blocks/src/context/block/BlockContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ export const BlockContextProvider: React.FC<BlockContextInputProps> = ({
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 (
Expand Down

0 comments on commit 4f30e77

Please sign in to comment.