Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

Commit

Permalink
variable needs to exist (#543)
Browse files Browse the repository at this point in the history
  • Loading branch information
whaught authored Sep 15, 2020
1 parent 127b0b3 commit b80594f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions pkg/controller/user/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,14 @@ func (c *Controller) HandleIndex() http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()

offset, err := strconv.Atoi(r.FormValue("offset"))
if err != nil {
controller.InternalError(w, r, c.h, err)
return
offset := 0
var err error
if qvar := r.FormValue("offset"); qvar != "" {
offset, err = strconv.Atoi(qvar)
if err != nil {
controller.InternalError(w, r, c.h, err)
return
}
}

realm := controller.RealmFromContext(ctx)
Expand Down

0 comments on commit b80594f

Please sign in to comment.