diff --git a/code/lib/core-server/src/build-static.ts b/code/lib/core-server/src/build-static.ts index 6bc5842b62a1..52bcb5eed7cd 100644 --- a/code/lib/core-server/src/build-static.ts +++ b/code/lib/core-server/src/build-static.ts @@ -168,11 +168,7 @@ export async function buildStaticStandalone( if (!core?.disableTelemetry) { effects.push( initializedStoryIndexGenerator.then(async (generator) => { - if (!generator) { - return; - } - - const storyIndex = await generator.getIndex(); + const storyIndex = await generator?.getIndex(); const payload = storyIndex ? { storyIndex: { diff --git a/code/lib/core-server/src/dev-server.ts b/code/lib/core-server/src/dev-server.ts index f20b19a635c5..89f95bff4b59 100644 --- a/code/lib/core-server/src/dev-server.ts +++ b/code/lib/core-server/src/dev-server.ts @@ -80,11 +80,7 @@ export async function storybookDevServer(options: Options) { if (!core?.disableTelemetry) { initializedStoryIndexGenerator.then(async (generator) => { - if (!generator) { - return; - } - - const storyIndex = await generator.getIndex(); + const storyIndex = await generator?.getIndex(); const payload = storyIndex ? { storyIndex: {