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 {
3939}
4040
4141func (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+
4250 file , ok := params .FileUpload .(* runtime.File )
4351 if ! ok {
4452 return storage .NewCreateStorageGeneralFileBadRequest ()
@@ -189,6 +197,14 @@ func (h *StorageReplaceStorageGeneralFileHandlerImpl) Handle(params storage.Repl
189197 return storage .NewReplaceStorageGeneralFileDefault (int (* e .Code )).WithPayload (e )
190198 }
191199
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+
192208 data , err := io .ReadAll (params .FileUpload )
193209 if err != nil {
194210 return storage .NewReplaceStorageGeneralFileBadRequest ()
You can’t perform that action at this time.
0 commit comments