From beb6d40ce629c21cbec16705c057d741767bf9b3 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Tue, 21 Aug 2018 15:38:51 -0700 Subject: [PATCH] Avoid crash when policy subsystem is not initialized (#6326) Fixes #6324 --- cmd/policy.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/policy.go b/cmd/policy.go index 43a9462ab..192aebc28 100644 --- a/cmd/policy.go +++ b/cmd/policy.go @@ -77,6 +77,10 @@ func (sys *PolicySys) Remove(bucketName string) { // IsAllowed - checks given policy args is allowed to continue the Rest API. func (sys *PolicySys) IsAllowed(args policy.Args) bool { + if sys == nil { + return args.IsOwner + } + sys.RLock() defer sys.RUnlock()