Browse Source

prevent nil

pull/2878/head
chrislu 3 years ago
parent
commit
bb4beebce3
  1. 3
      weed/filer/filechunks.go

3
weed/filer/filechunks.go

@ -23,6 +23,9 @@ func TotalSize(chunks []*filer_pb.FileChunk) (size uint64) {
} }
func FileSize(entry *filer_pb.Entry) (size uint64) { func FileSize(entry *filer_pb.Entry) (size uint64) {
if entry == nil || entry.Attributes == nil {
return 0
}
fileSize := entry.Attributes.FileSize fileSize := entry.Attributes.FileSize
if entry.RemoteEntry != nil { if entry.RemoteEntry != nil {
if entry.RemoteEntry.RemoteMtime > entry.Attributes.Mtime { if entry.RemoteEntry.RemoteMtime > entry.Attributes.Mtime {

Loading…
Cancel
Save