diff options
| author | Konstantin Lebedev <9497591+kmlebedev@users.noreply.github.com> | 2022-04-07 18:50:27 +0500 |
|---|---|---|
| committer | Konstantin Lebedev <9497591+kmlebedev@users.noreply.github.com> | 2022-04-07 18:50:27 +0500 |
| commit | f5246b748d30ce1d0687dee2089848c96492ffff (patch) | |
| tree | 5ebbde9317f9b3bff0b32d8976a09cdc61705786 /weed/filer/filechunks.go | |
| parent | 7ff248d5cda0dbcad722e2f7886bf3ca13874069 (diff) | |
| parent | abe3cc6df228a2700f25557f7d600f6810b450bf (diff) | |
| download | seaweedfs-f5246b748d30ce1d0687dee2089848c96492ffff.tar.xz seaweedfs-f5246b748d30ce1d0687dee2089848c96492ffff.zip | |
Merge branch 'new_master' into hashicorp_raft
# Conflicts:
# weed/pb/master_pb/master.pb.go
Diffstat (limited to 'weed/filer/filechunks.go')
| -rw-r--r-- | weed/filer/filechunks.go | 3 |
1 files changed, 3 insertions, 0 deletions
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 { |
