Skip to content

Commit 36657b0

Browse files
committed
bandaid it instead
License: MIT Signed-off-by: Mateja Milosevic [email protected]
1 parent 54bea78 commit 36657b0

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

commands/http/parse.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,6 @@ func Parse(r *http.Request, root *cmds.Command) (cmds.Request, error) {
122122
return nil, fmt.Errorf("File argument '%s' is required", requiredFile)
123123
}
124124

125-
if f != nil && f.FullPath() == "" {
126-
return nil, fmt.Errorf("Corrupted data passed as file argument")
127-
}
128-
129125
req, err := cmds.NewRequest(pth, opts, args, f, cmd, optDefs)
130126
if err != nil {
131127
return nil, err

core/coreunix/add.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,11 @@ func (adder *Adder) Finalize() (node.Node, error) {
223223
if err != nil {
224224
return nil, err
225225
}
226+
227+
if len(children) == 0 {
228+
return nil, fmt.Errorf("expected at least one child dir, got none")
229+
}
230+
226231
name = children[0]
227232

228233
mr, err := adder.mfsRoot()

0 commit comments

Comments
 (0)