Check if eventN is initialized before notifying in Upload web handler (#2435)

master
Anis Elleuch 8 years ago committed by Harshavardhana
parent 76d56c6ff2
commit 51d7749c3e
  1. 5
      event-notifier.go

@ -138,7 +138,10 @@ func (en *eventNotifier) RemoveLambdaTarget(lambdaARN string, listenerCh chan []
} }
// Returns true if bucket notification is set for the bucket, false otherwise. // Returns true if bucket notification is set for the bucket, false otherwise.
func (en eventNotifier) IsBucketNotificationSet(bucket string) bool { func (en *eventNotifier) IsBucketNotificationSet(bucket string) bool {
if en == nil {
return false
}
en.rwMutex.RLock() en.rwMutex.RLock()
defer en.rwMutex.RUnlock() defer en.rwMutex.RUnlock()
_, ok := en.notificationConfigs[bucket] _, ok := en.notificationConfigs[bucket]

Loading…
Cancel
Save