mirror of
https://mau.dev/mautrix/go.git
synced 2026-03-14 14:25:53 +01:00
error: ignore RespError.Write calls with nil writer
Some checks failed
Some checks failed
This commit is contained in:
parent
3f08ef0d57
commit
e17cb83855
1 changed files with 3 additions and 0 deletions
3
error.go
3
error.go
|
|
@ -147,6 +147,9 @@ func (e *RespError) MarshalJSON() ([]byte, error) {
|
|||
}
|
||||
|
||||
func (e RespError) Write(w http.ResponseWriter) {
|
||||
if w == nil {
|
||||
return
|
||||
}
|
||||
statusCode := e.StatusCode
|
||||
if statusCode == 0 {
|
||||
statusCode = http.StatusInternalServerError
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue