From b80594f0964978af0c383d6151895fef2f2d29a3 Mon Sep 17 00:00:00 2001 From: Weston Haught Date: Mon, 14 Sep 2020 17:23:29 -0700 Subject: [PATCH] variable needs to exist (#543) --- pkg/controller/user/index.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pkg/controller/user/index.go b/pkg/controller/user/index.go index 300c3c1e6..5c1a31655 100644 --- a/pkg/controller/user/index.go +++ b/pkg/controller/user/index.go @@ -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)