Avoid crash when policy subsystem is not initialized (#6326)

Fixes #6324
master
Harshavardhana 6 years ago committed by GitHub
parent 19db921555
commit beb6d40ce6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      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()

Loading…
Cancel
Save