From 585bd271fa3f74283923d133f657a5ae65c0baf3 Mon Sep 17 00:00:00 2001 From: Jeff Witt <152964771+witt3rd@users.noreply.github.com> Date: Thu, 5 Feb 2026 06:46:20 -0500 Subject: [PATCH] Fix null reference error in waitError when act.result is undefined The waitError function assumes act.result is already initialized, but this is not always the case. When a wait error occurs before act.result is set, the function crashes with: TypeError: Cannot set property 'found' of undefined This adds a nullish coalescing assignment to initialize act.result to an empty object if it's undefined before setting properties on it. --- run.js | 1 + 1 file changed, 1 insertion(+) diff --git a/run.js b/run.js index 8690a0a7..c3fef3c4 100644 --- a/run.js +++ b/run.js @@ -759,6 +759,7 @@ const isTrue = (object, specs) => { // Adds a wait error result to an act. const waitError = (page, act, error, what) => { console.log(`ERROR waiting for ${what} (${error.message})`); + act.result ??= {}; act.result.found = false; act.result.url = page.url(); act.result.error = `ERROR waiting for ${what}`;