diff --git a/CHANGELOG.md b/CHANGELOG.md index 21f3d334..dd4f9921 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ * Diagnostic tool: add the result of `prosodyctl check` in the debug section. * New debug mode * Fix room topic: due to a [bug in mod_muc_http_defaults](https://hg.prosody.im/prosody-modules/rev/6d99ddd99694), room topics were badly configured. The plugin will fix them at startup, and stops trying to set the subject. +* Fix Peertube crash when someone attemps to connect to Websocket endpoint during plugin initialization. ## 6.2.3 diff --git a/server/lib/routers/webchat.ts b/server/lib/routers/webchat.ts index 33e52181..5d4834b1 100644 --- a/server/lib/routers/webchat.ts +++ b/server/lib/routers/webchat.ts @@ -234,7 +234,10 @@ async function initWebchatRouter (options: RegisterServerOptionsV5): Promise { if (!currentWebsocketProxy) { - throw new Error('There is no current websocket proxy, should not get here.') + peertubeHelpers.logger.error('There is no current websocket proxy, should not get here.') + // no need to close the socket, Peertube will + // (see https://github.com/Chocobozzz/PeerTube/issues/5752#issuecomment-1510870894) + return } currentWebsocketProxy.ws(request, socket, head) }