add some nil checks for unexpected lock failures

This commit is contained in:
James Bardin 2017-04-05 09:06:47 -04:00
parent c3bfbe6756
commit eeddc3f8ea
1 changed files with 3 additions and 3 deletions

View File

@ -94,9 +94,9 @@ func LockWithContext(ctx context.Context, s State, info *LockInfo) (string, erro
return "", err return "", err
} }
if le.Info.ID == "" { if le == nil || le.Info == nil || le.Info.ID == "" {
// the lock has no ID, something is wrong so don't keep trying // If we dont' have a complete LockError, there's something wrong with the lock
return "", fmt.Errorf("lock error missing ID: %s", err) return "", err
} }
if postLockHook != nil { if postLockHook != nil {