From df461402cccd28fc863d78aba3304893ef82f328 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 21 Mar 2021 22:27:30 -0700 Subject: [PATCH] ensure entry attribute is not nill fix https://github.com/chrislusf/seaweedfs/issues/1926 --- weed/filesys/file.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/weed/filesys/file.go b/weed/filesys/file.go index b73cd895b..da93e0fae 100644 --- a/weed/filesys/file.go +++ b/weed/filesys/file.go @@ -280,6 +280,9 @@ func (file *File) maybeLoadEntry(ctx context.Context) (entry *filer_pb.Entry, er return entry, err } if entry != nil { + if entry.Attributes == nil { + entry.Attributes = &filer_pb.FuseAttributes{} + } file.setEntry(entry) } else { glog.Warningf("maybeLoadEntry not found entry %s/%s: %v", file.dir.FullPath(), file.Name, err)