Browse Source

Merge pull request #7479 from heyitsanthony/auth-admin-nilcheck

auth: nil check AuthInfo when checking admin permissions
Xiang Li 8 years ago
parent
commit
76aa7f6935
1 changed files with 3 additions and 0 deletions
  1. 3 0
      auth/store.go

+ 3 - 0
auth/store.go

@@ -744,6 +744,9 @@ func (as *authStore) IsAdminPermitted(authInfo *AuthInfo) error {
 	if !as.isAuthEnabled() {
 		return nil
 	}
+	if authInfo == nil {
+		return ErrUserEmpty
+	}
 
 	tx := as.be.BatchTx()
 	tx.Lock()