mirror of
https://github.com/restic/restic.git
synced 2025-10-09 13:04:00 +00:00
restore: move nil pointer check into restoreui
This commit is contained in:
@@ -59,6 +59,10 @@ func (p *Progress) update(runtime time.Duration, final bool) {
|
||||
|
||||
// AddFile starts tracking a new file with the given size
|
||||
func (p *Progress) AddFile(size uint64) {
|
||||
if p == nil {
|
||||
return
|
||||
}
|
||||
|
||||
p.m.Lock()
|
||||
defer p.m.Unlock()
|
||||
|
||||
@@ -68,6 +72,10 @@ func (p *Progress) AddFile(size uint64) {
|
||||
|
||||
// AddProgress accumulates the number of bytes written for a file
|
||||
func (p *Progress) AddProgress(name string, bytesWrittenPortion uint64, bytesTotal uint64) {
|
||||
if p == nil {
|
||||
return
|
||||
}
|
||||
|
||||
p.m.Lock()
|
||||
defer p.m.Unlock()
|
||||
|
||||
|
Reference in New Issue
Block a user