diff options
| author | Chris Lu <chris.lu@gmail.com> | 2018-12-02 22:57:59 -0800 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2018-12-02 22:57:59 -0800 |
| commit | bea162c34c846dcaa79b76afd98d2f700694f971 (patch) | |
| tree | 60fa9ffc0cb54876c8c94e9e31ec66f406724b1e | |
| parent | d3be8e022f628c497abdfa41334822182560ff2f (diff) | |
| download | seaweedfs-bea162c34c846dcaa79b76afd98d2f700694f971.tar.xz seaweedfs-bea162c34c846dcaa79b76afd98d2f700694f971.zip | |
add warning for empty attributes
| -rw-r--r-- | weed/server/filer_grpc_server.go | 4 |
1 files changed, 4 insertions, 0 deletions
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), |
