Skip to content

Commit

Permalink
Merge pull request #779 from isucon/fix/benchmark-nil-matching-data
Browse files Browse the repository at this point in the history
fix: matchingDataがnilのときを考慮する
  • Loading branch information
sapphi-red authored Dec 7, 2024
2 parents 1cf6464 + f7d17ba commit afce719
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions bench/benchmarker/world/chair.go
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,9 @@ func (c *Chair) HandleNotification(event NotificationEvent) error {
}

func (c *Chair) ValidateChairNotificationEvent(rideID string, event ChairNotificationEvent) error {
if c.matchingData == nil {
return fmt.Errorf("進行中のライドがないときに進行中状態の通知が届きました (ride_id: %s)", rideID)
}
if event.User.ID != c.matchingData.User.ID {
return fmt.Errorf("ユーザーのIDが一致しません。(ride_id: %s, got: %s, want: %s", rideID, event.User.ID, c.matchingData.User.ID)
}
Expand Down

0 comments on commit afce719

Please sign in to comment.