mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-25 16:31:10 -06:00
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
|
||||
}
|
||||
|
||||
if le.Info.ID == "" {
|
||||
// the lock has no ID, something is wrong so don't keep trying
|
||||
return "", fmt.Errorf("lock error missing ID: %s", err)
|
||||
if le == nil || le.Info == nil || le.Info.ID == "" {
|
||||
// If we dont' have a complete LockError, there's something wrong with the lock
|
||||
return "", err
|
||||
}
|
||||
|
||||
if postLockHook != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user