From 51d7749c3e6378c0f8d42df3ddbb063fc4cf1330 Mon Sep 17 00:00:00 2001 From: Anis Elleuch Date: Mon, 15 Aug 2016 20:15:46 +0100 Subject: [PATCH] Check if eventN is initialized before notifying in Upload web handler (#2435) --- event-notifier.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/event-notifier.go b/event-notifier.go index 9fccc87bb..27c18a45a 100644 --- a/event-notifier.go +++ b/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. -func (en eventNotifier) IsBucketNotificationSet(bucket string) bool { +func (en *eventNotifier) IsBucketNotificationSet(bucket string) bool { + if en == nil { + return false + } en.rwMutex.RLock() defer en.rwMutex.RUnlock() _, ok := en.notificationConfigs[bucket]