add some nil checks for unexpected lock failures
This commit is contained in:
parent
c3bfbe6756
commit
eeddc3f8ea
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue