Boards: Avoid panic in Boards file request handler when file not found. (#22792)
* Avoid panic in Boards file request handler when file not found.
Этот коммит содержится в:
@@ -145,6 +145,12 @@ func (a *API) handleServeFile(w http.ResponseWriter, r *http.Request) {
|
|||||||
_ = a.app.MoveFile(board.ChannelID, board.TeamID, boardID, filename)
|
_ = a.app.MoveFile(board.ChannelID, board.TeamID, boardID, filename)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
// if err is still not nil then it is an error other than `not found` so we must
|
||||||
|
// return the error to the requestor. fileReader and Fileinfo are nil in this case.
|
||||||
|
a.errorResponse(w, r, err)
|
||||||
|
}
|
||||||
|
|
||||||
defer fileReader.Close()
|
defer fileReader.Close()
|
||||||
|
|
||||||
mimeType := ""
|
mimeType := ""
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user