wrong or no params in user login crashes stork server
Jun 05 06:00:39 stork-server stork-server[3800]: 2020/06/05 06:00:39 http: panic serving 127.0.0.1:47870: runtime error: invalid memory address or nil pointer dereference
Jun 05 06:00:39 stork-server stork-server[3800]: goroutine 39 [running]:
Jun 05 06:00:39 stork-server stork-server[3800]: net/http.(*conn).serve.func1(0xc0000adea0)
Jun 05 06:00:39 stork-server stork-server[3800]: /build/tools/1.13.5/go/src/net/http/server.go:1767 +0x139
Jun 05 06:00:39 stork-server stork-server[3800]: panic(0xbe2e60, 0x134ee80)
Jun 05 06:00:39 stork-server stork-server[3800]: /build/tools/1.13.5/go/src/runtime/panic.go:679 +0x1b2
Jun 05 06:00:39 stork-server stork-server[3800]: isc.org/stork/server/restservice.(*RestAPI).CreateSession(0xc000128900, 0xe29ac0, 0xc0004085d0, 0xc0001d4b00, 0x0, 0x0, 0xc000408540, 0xe29ac0)
Jun 05 06:00:39 stork-server stork-server[3800]: /build/backend/server/restservice/restusers.go:56 +0x57
Jun 05 06:00:39 stork-server stork-server[3800]: isc.org/stork/server/gen/restapi.HandlerAPI.func3(0xc0001d4b00, 0x0, 0x0, 0xc000408501, 0xc00069a280)
Jun 05 06:00:39 stork-server stork-server[3800]: /build/backend/server/gen/restapi/configure_stork.go:144 +0x6e
Jun 05 06:00:39 stork-server stork-server[3800]: isc.org/stork/server/gen/restapi/operations/users.CreateSessionHandlerFunc.Handle(0xc0001aa150, 0xc0001d4b00, 0x0, 0x0, 0xc00069a280, 0x0)
Jun 05 06:00:39 stork-server stork-server[3800]: /build/backend/server/gen/restapi/operations/users/create_session.go:19 +0x44
Jun 05 06:00:39 stork-server stork-server[3800]: isc.org/stork/server/gen/restapi/operations/users.(*CreateSession).ServeHTTP(0xc0001c7c40, 0xe25f00, 0xc000518340, 0xc0001d4b00)
Jun 05 06:00:39 stork-server stork-server[3800]: /build/backend/server/gen/restapi/operations/users/create_session.go:54 +0x176
Jun 05 06:00:39 stork-server stork-server[3800]: github.com/go-openapi/runtime/middleware.NewOperationExecutor.func1(0xe25f00, 0xc000518340, 0xc0001d4b00)
Jun 05 06:00:39 stork-server stork-server[3800]: /root/go/pkg/mod/github.com/go-openapi/runtime@v0.19.6/middleware/operation.go:28 +0x75
Jun 05 06:00:39 stork-server stork-server[3800]: net/http.HandlerFunc.ServeHTTP(0xc0000abd00, 0xe25f00, 0xc000518340, 0xc0001d4b00)
Jun 05 06:00:39 stork-server stork-server[3800]: /build/tools/1.13.5/go/src/net/http/server.go:2007 +0x44
Jun 05 06:00:39 stork-server stork-server[3800]: github.com/alexedwards/scs/v2.(*SessionManager).LoadAndSave.func1(0xe27540, 0xc0005341c0, 0xc0001d4a00)
Jun 05 06:00:39 stork-server stork-server[3800]: /root/go/pkg/mod/github.com/alexedwards/scs/v2@v2.2.0/session.go:136 +0x205
Jun 05 06:00:39 stork-server stork-server[3800]: net/http.HandlerFunc.ServeHTTP(0xc0001c7ee0, 0xe27540, 0xc0005341c0, 0xc0001d4a00)
Edited by Michal Nowikowski