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

Fixes #6324
This commit is contained in:
Harshavardhana 2018-08-21 15:38:51 -07:00 committed by GitHub
parent 19db921555
commit beb6d40ce6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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()