fix null deref in js
This commit is contained in:
@@ -73,10 +73,9 @@ async function onButtonClick() {
|
|||||||
applicationServerKey: publicKey
|
applicationServerKey: publicKey
|
||||||
})
|
})
|
||||||
|
|
||||||
registeredSubscription.locations.push(loc)
|
|
||||||
|
|
||||||
let newSubscription
|
let newSubscription
|
||||||
if (registeredSubscription) {
|
if (registeredSubscription) {
|
||||||
|
registeredSubscription.locations.push(loc)
|
||||||
newSubscription = await fetch(`/registrations/${registeredSubscription.id}`, {
|
newSubscription = await fetch(`/registrations/${registeredSubscription.id}`, {
|
||||||
method: "PATCH",
|
method: "PATCH",
|
||||||
headers: {
|
headers: {
|
||||||
@@ -104,6 +103,7 @@ async function onButtonClick() {
|
|||||||
|
|
||||||
getSummaryButton.innerText = "Stop updates"
|
getSummaryButton.innerText = "Stop updates"
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
console.error(error)
|
||||||
alert(`Error when trying to subscribe to updates: ${error}`)
|
alert(`Error when trying to subscribe to updates: ${error}`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user