From 0533bf4092b86e46219dae4580c3b9fb67761a91 Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Tue, 21 Mar 2023 17:19:24 -0700 Subject: [PATCH] Fix nre when handling failed browser push notifications. Closes #2855 --- notifications/browser/browser.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/notifications/browser/browser.go b/notifications/browser/browser.go index 2bf4694fb..0740d777f 100644 --- a/notifications/browser/browser.go +++ b/notifications/browser/browser.go @@ -72,10 +72,12 @@ func (b *Browser) Send( // Not really the subscriber, but a contact point for the sender. Subscriber: "owncast@owncast.online", }) + if err != nil { + return false, errors.Wrap(err, "error sending browser push notification") + } + if resp.StatusCode == 410 { return true, nil - } else if err != nil { - return false, errors.Wrap(err, "error sending browser push notification") } defer resp.Body.Close()