webrtc: fix crash in case of errors during PATCH (#2609) (#2613)

This commit is contained in:
Alessandro Ros 2023-10-30 19:53:03 +01:00 committed by GitHub
parent a2c092ea44
commit ecee2af05c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -254,7 +254,7 @@ func (s *webRTCHTTPServer) onWHIPPatch(ctx *gin.Context, rawSecret string) {
candidates: candidates,
})
if res.err != nil {
webrtcWriteError(ctx, http.StatusInternalServerError, err)
webrtcWriteError(ctx, http.StatusInternalServerError, res.err)
return
}