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

Commit b80594f

Browse files
authored
variable needs to exist (#543)
1 parent 127b0b3 commit b80594f

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

pkg/controller/user/index.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,14 @@ func (c *Controller) HandleIndex() http.Handler {
4242
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
4343
ctx := r.Context()
4444

45-
offset, err := strconv.Atoi(r.FormValue("offset"))
46-
if err != nil {
47-
controller.InternalError(w, r, c.h, err)
48-
return
45+
offset := 0
46+
var err error
47+
if qvar := r.FormValue("offset"); qvar != "" {
48+
offset, err = strconv.Atoi(qvar)
49+
if err != nil {
50+
controller.InternalError(w, r, c.h, err)
51+
return
52+
}
4953
}
5054

5155
realm := controller.RealmFromContext(ctx)

0 commit comments

Comments
 (0)