From 6e3e2ff4bafeb231ff7211dd482b666826e385ad Mon Sep 17 00:00:00 2001 From: nilshah98 Date: Thu, 26 Oct 2023 16:47:13 +0530 Subject: [PATCH] fix: check if error exists before checking for message attribute --- src/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.js b/src/utils.js index 8448b472..f8d428c6 100644 --- a/src/utils.js +++ b/src/utils.js @@ -142,7 +142,7 @@ export async function* withPage(percy, url, callback, retry) { return yield* yieldTo(callback(page)); } catch (error) { // if the page crashed and retry returns truthy, try again - if (error.message?.includes('crashed') && retry?.()) { + if (error?.message?.includes('crashed') && retry?.()) { return yield* withPage(...arguments); }