Skip to content

Commit

Permalink
Update subscription.go
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenWeathers committed Mar 31, 2024
1 parent f723b7d commit 4aa73a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/webhook/subscription/subscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func (s *Service) HandleWebhook() http.HandlerFunc {
w.WriteHeader(http.StatusBadRequest) // Return a 400 error on a bad signature
return
}
if len(cs.LineItems.Data) != 1 {
if cs.LineItems == nil || len(cs.LineItems.Data) != 1 {
logger.Error("Error getting subscription product from event", zap.String("eventId", event.ID),
zap.String("sessionId", cs.ID))
w.WriteHeader(http.StatusBadRequest) // Return a 400 error on a bad signature
Expand Down

0 comments on commit 4aa73a1

Please sign in to comment.