From ba69c19baa42bd0a34f24bd4dd9da8bdc5fd2a8e Mon Sep 17 00:00:00 2001 From: Simon Knott Date: Mon, 30 Dec 2024 11:55:31 +0100 Subject: [PATCH] internal error --- packages/playwright/src/runner/dispatcher.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/playwright/src/runner/dispatcher.ts b/packages/playwright/src/runner/dispatcher.ts index 0dc46287c4..534fe7eb4a 100644 --- a/packages/playwright/src/runner/dispatcher.ts +++ b/packages/playwright/src/runner/dispatcher.ts @@ -362,8 +362,13 @@ class JobDispatcher { body: params.body !== undefined ? Buffer.from(params.body, 'base64') : undefined }; data.result.attachments.push(attachment); - if (params.stepId) - data.steps.get(params.stepId)!.attachments.push(attachment); + if (params.stepId) { + const step = data.steps.get(params.stepId); + if (step) + step.attachments.push(attachment); + else + this._reporter.onStdErr?.('Internal error: step id not found: ' + params.stepId); + } } private _failTestWithErrors(test: TestCase, errors: TestError[]) {