File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,14 @@ type StorageCreateStorageGeneralFileHandlerImpl struct {
39
39
}
40
40
41
41
func (h * StorageCreateStorageGeneralFileHandlerImpl ) Handle (params storage.CreateStorageGeneralFileParams , principal interface {}) middleware.Responder {
42
+ if params .FileUpload == nil {
43
+ e := & models.Error {
44
+ Code : misc .Int64P (400 ),
45
+ Message : misc .StringP ("No file_upload form param specified" ),
46
+ }
47
+ return storage .NewReplaceStorageGeneralFileBadRequest ().WithPayload (e )
48
+ }
49
+
42
50
file , ok := params .FileUpload .(* runtime.File )
43
51
if ! ok {
44
52
return storage .NewCreateStorageGeneralFileBadRequest ()
@@ -189,6 +197,14 @@ func (h *StorageReplaceStorageGeneralFileHandlerImpl) Handle(params storage.Repl
189
197
return storage .NewReplaceStorageGeneralFileDefault (int (* e .Code )).WithPayload (e )
190
198
}
191
199
200
+ if params .FileUpload == nil {
201
+ e := & models.Error {
202
+ Code : misc .Int64P (400 ),
203
+ Message : misc .StringP ("No file_upload form param specified" ),
204
+ }
205
+ return storage .NewReplaceStorageGeneralFileBadRequest ().WithPayload (e )
206
+ }
207
+
192
208
data , err := io .ReadAll (params .FileUpload )
193
209
if err != nil {
194
210
return storage .NewReplaceStorageGeneralFileBadRequest ()
You can’t perform that action at this time.
0 commit comments