checking for nil backends before attempting to rollback on a backend (#2997)

This commit is contained in:
Chris Hoffman 2017-07-12 13:12:55 -07:00 committed by GitHub
parent 3fe372c7da
commit 6651f3aa33
1 changed files with 8 additions and 1 deletions

View File

@ -113,8 +113,15 @@ func (m *RollbackManager) triggerRollbacks() {
for _, e := range backends { for _, e := range backends {
path := e.Path path := e.Path
if e.Table == credentialTableType { if e.Table == credentialTableType {
path = "auth/" + path path = credentialRoutePrefix + path
} }
// When the mount is filtered, the backend will be nil
backend := m.router.MatchingBackend(path)
if backend == nil {
continue
}
m.inflightLock.RLock() m.inflightLock.RLock()
_, ok := m.inflight[path] _, ok := m.inflight[path]
m.inflightLock.RUnlock() m.inflightLock.RUnlock()