From f53cff045f952ec5dc2d0ea59cdbb8022628bff0 Mon Sep 17 00:00:00 2001 From: Konstantin Lebedev <9497591+kmlebedev@users.noreply.github.com> Date: Thu, 10 Mar 2022 18:58:56 +0500 Subject: [PATCH] checks disk file exist --- weed/storage/backend/disk_file.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/weed/storage/backend/disk_file.go b/weed/storage/backend/disk_file.go index 3b42429cf..cd5207356 100644 --- a/weed/storage/backend/disk_file.go +++ b/weed/storage/backend/disk_file.go @@ -70,7 +70,10 @@ func (df *DiskFile) Close() error { } func (df *DiskFile) GetStat() (datSize int64, modTime time.Time, err error) { - return df.fileSize, df.modTime, nil + if df.File == nil { + err = os.ErrInvalid + } + return df.fileSize, df.modTime, err } func (df *DiskFile) Name() string {