diff --git a/cmd/restic/lock.go b/cmd/restic/lock.go index ad5ac6841..b0df2b685 100644 --- a/cmd/restic/lock.go +++ b/cmd/restic/lock.go @@ -86,6 +86,10 @@ func refreshLocks(wg *sync.WaitGroup, done <-chan struct{}) { } func unlockRepo(lock *restic.Lock) error { + if lock == nil { + return nil + } + globalLocks.Lock() defer globalLocks.Unlock()