diff --git a/weed/filer/filechunks.go b/weed/filer/filechunks.go index fd9694b38..11a779147 100644 --- a/weed/filer/filechunks.go +++ b/weed/filer/filechunks.go @@ -23,6 +23,9 @@ func TotalSize(chunks []*filer_pb.FileChunk) (size uint64) { } func FileSize(entry *filer_pb.Entry) (size uint64) { + if entry == nil || entry.Attributes == nil { + return 0 + } fileSize := entry.Attributes.FileSize if entry.RemoteEntry != nil { if entry.RemoteEntry.RemoteMtime > entry.Attributes.Mtime {