mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
prevent nil
This commit is contained in:
parent
ae5aa2bf04
commit
bb4beebce3
|
@ -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…
Reference in a new issue