From 7d4da1c66ad434d85452b311f6acd36ca8727037 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Thu, 1 Mar 2018 13:17:40 +0000 Subject: [PATCH] local: fix crash on Stat error while reading a file --- backend/local/local.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/local/local.go b/backend/local/local.go index b810a5078..11765cdb1 100644 --- a/backend/local/local.go +++ b/backend/local/local.go @@ -671,6 +671,9 @@ type localOpenFile struct { func (file *localOpenFile) Read(p []byte) (n int, err error) { // Check if file has the same size and modTime fi, err := file.fd.Stat() + if err != nil { + return 0, errors.Wrap(err, "can't read status of source file while transferring") + } if file.o.size != fi.Size() || file.o.modTime != fi.ModTime() { return 0, errors.New("can't copy - source file is being updated") }