From ef586fbbccd653bc9b777a7d821896e2f9bec99d Mon Sep 17 00:00:00 2001 From: danielruss Date: Fri, 28 Jun 2024 14:53:24 -0400 Subject: [PATCH] fix soccer null problem (#450) --- localforageDAO.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/localforageDAO.js b/localforageDAO.js index beb63c0..80074c1 100644 --- a/localforageDAO.js +++ b/localforageDAO.js @@ -39,6 +39,9 @@ export async function restoreResults(results) { if (typeof results[qid] == "string") { // in this case get the first input/textarea in the form and fill it in. let element = formElement.querySelector("input,textarea,select"); + // If the element is not on the page + // it could have been dynamically create (think SOCcer...) just return.. + if (!element) return // null handle element, skip if null (load failing when participant is in the middle of unanswered SOCcer questions) if (element?.type == "radio") { let selector = `input[value='${results[qid]}']`;