fix: nil pointer access

This commit is contained in:
Kevin Franklin Kim 2024-07-10 08:55:29 +02:00
parent e5f48dcad8
commit d88146a2e9
No known key found for this signature in database

View File

@ -104,7 +104,7 @@ func (s *Subscriber) ServeHTTP(w http.ResponseWriter, r *http.Request) {
}
// validate
if payload.EventName.String() == "" {
if payload.EventName == nil || payload.EventName.String() == "" {
http.Error(w, "missing event name", http.StatusBadRequest)
return
}