Skip to content

Commit 0349985

Browse files
committed
Merge pull request #14217 from jakubriedl/patch-1
Addon-docs: Fix source block error on dynamically-generated stories
1 parent a206089 commit 0349985

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

addons/docs/src/blocks/enhanceSource.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ const extract = (targetId: string, { source, locationsMap }: StorySource) => {
2020

2121
const sanitizedStoryName = storyIdToSanitizedStoryName(targetId);
2222
const location = locationsMap[sanitizedStoryName];
23+
if (!location) {
24+
return source;
25+
}
2326
const lines = source.split('\n');
2427

2528
return extractSource(location, lines);

0 commit comments

Comments
 (0)