Skip to content

Commit d1817d1

Browse files
committed
Return early
Signed-off-by: Danny Kopping <danny@coder.com>
1 parent d627fef commit d1817d1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

coderd/notifications.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,12 @@ func (api *API) putNotificationsSettings(rw http.ResponseWriter, r *http.Request
105105
if err != nil {
106106
if rbac.IsUnauthorizedError(err) {
107107
httpapi.Forbidden(rw)
108-
} else {
109-
httpapi.Write(ctx, rw, http.StatusInternalServerError, codersdk.Response{
110-
Message: "Failed to update notifications settings.",
111-
Detail: err.Error(),
112-
})
108+
return
113109
}
110+
httpapi.Write(ctx, rw, http.StatusInternalServerError, codersdk.Response{
111+
Message: "Failed to update notifications settings.",
112+
Detail: err.Error(),
113+
})
114114

115115
return
116116
}

0 commit comments

Comments
 (0)