Skip to content

Commit

Permalink
fix api nil reference error
Browse files Browse the repository at this point in the history
  • Loading branch information
mpoegel committed May 13, 2024
1 parent bb20f18 commit eab0135
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion go.mod
Expand Up @@ -6,6 +6,7 @@ require (
github.com/Nerzal/gocloak/v13 v13.9.0
github.com/coreos/go-oidc v2.2.1+incompatible
github.com/golang-jwt/jwt/v5 v5.0.0
github.com/google/jsonapi v1.0.0
github.com/google/uuid v1.3.0
github.com/gorilla/mux v1.8.0
github.com/mattn/go-sqlite3 v1.14.19
Expand All @@ -26,7 +27,6 @@ require (
github.com/go-resty/resty/v2 v2.7.0 // indirect
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/jsonapi v1.0.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.1 // indirect
github.com/googleapis/gax-go/v2 v2.7.0 // indirect
github.com/kr/text v0.2.0 // indirect
Expand Down
5 changes: 4 additions & 1 deletion pkg/pizza/server_api.go
Expand Up @@ -125,10 +125,13 @@ func (s *Server) HandleAPIGetFriday(token *jwt.Token, claims *TokenClaims, w htt
friday := &api.Friday{
ID: id,
StartTime: f.Date,
Details: *f.Details,
Guests: nil,
}

if f.Details != nil {
friday.Details = *f.Details
}

// not part of invited group
if f.Group != nil && !claims.InGroup(*f.Group) {
// if this friday was specifically requested, the response needs to be 404
Expand Down

0 comments on commit eab0135

Please sign in to comment.