error: ignore RespError.Write calls with nil writer
Some checks failed
Go / Lint (latest) (push) Has been cancelled
Go / Build (old, libolm) (push) Has been cancelled
Go / Build (latest, libolm) (push) Has been cancelled
Go / Build (old, goolm) (push) Has been cancelled
Go / Build (latest, goolm) (push) Has been cancelled

This commit is contained in:
Tulir Asokan 2024-10-20 19:43:55 +03:00
commit e17cb83855

View file

@ -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