Skip to content

Commit

Permalink
Add nil check to response
Browse files Browse the repository at this point in the history
  • Loading branch information
victor-carvalho committed Mar 2, 2021
1 parent ac5026b commit df5f067
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/room_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func (g *PlayerEventHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
return
}

if resp.Code != 200 {
if resp != nil && resp.Code != 200 {
err := errors.New(resp.Message)
logger.WithError(err).Error("Player event forward failed.")
g.App.HandleError(w, resp.Code, "player event forward failed", err)
Expand Down

0 comments on commit df5f067

Please sign in to comment.