From bea162c34c846dcaa79b76afd98d2f700694f971 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 2 Dec 2018 22:57:59 -0800 Subject: [PATCH] add warning for empty attributes --- weed/server/filer_grpc_server.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/weed/server/filer_grpc_server.go b/weed/server/filer_grpc_server.go index ca318db05..42069c54c 100644 --- a/weed/server/filer_grpc_server.go +++ b/weed/server/filer_grpc_server.go @@ -113,6 +113,10 @@ func (fs *FilerServer) CreateEntry(ctx context.Context, req *filer_pb.CreateEntr fs.filer.DeleteChunks(garbages) + if req.Entry.Attributes == nil { + return nil, fmt.Errorf("can not create entry with empty attributes") + } + err = fs.filer.CreateEntry(&filer2.Entry{ FullPath: fullpath, Attr: filer2.PbToEntryAttribute(req.Entry.Attributes),