From eeddc3f8ea6a22778785551bee2d598c93915087 Mon Sep 17 00:00:00 2001 From: James Bardin Date: Wed, 5 Apr 2017 09:06:47 -0400 Subject: [PATCH] add some nil checks for unexpected lock failures --- state/state.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/state/state.go b/state/state.go index f6c4f16d4e..45163852b2 100644 --- a/state/state.go +++ b/state/state.go @@ -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 {