Corrects mistake.
Corrects mistake. License: MIT Signed-off-by: Mateja Milosevic <minima38123@gmail.com>
Quantomic committed
Jul 9, 2017 at 21:33 UTC
068b7f7f21090d6ab95f7eaa33a71b4344757cfb
1 file changed
+4
-4
commands/http/parse.go
+4
-4
@@ -122,15 +122,15 @@ func Parse(r *http.Request, root *cmds.Command) (cmds.Request, error) {
122
}
123
}
124
125
- if f.FullPath() == "" {
126
- return nil, fmt.Errorf("Corrupted data passed as file argument")
127
- }
128
-
125
// if there is a required filearg, error if no files were provided
126
if len(requiredFile) > 0 && f == nil {
127
return nil, fmt.Errorf("File argument '%s' is required", requiredFile)
128
}
129
130
+ if f != nil && f.FullPath() == "" {
131
+ return nil, fmt.Errorf("Corrupted data passed as file argument")
132
+ }
133
+
134
req, err := cmds.NewRequest(pth, opts, args, f, cmd, optDefs)
135
if err != nil {
136
return nil, err