From 19772a2521549ab3d1f046d94325cb6c928cda43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Mon, 9 Sep 2024 09:46:22 +0200 Subject: [PATCH] Avoid unnecessary additional error --- buildtools/check-example.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/buildtools/check-example.js b/buildtools/check-example.js index a0be181082c2..79a8164bc87a 100644 --- a/buildtools/check-example.js +++ b/buildtools/check-example.js @@ -294,6 +294,8 @@ function loaded(page, browser) { loaded(page, browser); })().catch(async (error) => { console.log(`Unexpected error: ${error}.`); - await browser.close(); + if (browser && !browserClosed) { + await browser.close(); + } process.exit(2); });