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); }