From 93bf51a6f538b084499477adf3e517697c1fded8 Mon Sep 17 00:00:00 2001 From: Kenneth Date: Sat, 10 May 2025 15:22:07 +0100 Subject: [PATCH] fix null deref in js --- web/summary.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/summary.js b/web/summary.js index 463e9cc..8bda57a 100644 --- a/web/summary.js +++ b/web/summary.js @@ -73,10 +73,9 @@ async function onButtonClick() { applicationServerKey: publicKey }) - registeredSubscription.locations.push(loc) - let newSubscription if (registeredSubscription) { + registeredSubscription.locations.push(loc) newSubscription = await fetch(`/registrations/${registeredSubscription.id}`, { method: "PATCH", headers: { @@ -104,6 +103,7 @@ async function onButtonClick() { getSummaryButton.innerText = "Stop updates" } catch (error) { + console.error(error) alert(`Error when trying to subscribe to updates: ${error}`) } }