From f7ab601618d10cb9b72e5548e5af6943d147dc2f Mon Sep 17 00:00:00 2001 From: nklhrstv Date: Thu, 19 Mar 2020 09:46:52 +0200 Subject: [PATCH] intersept load action only if the middleware is not destroyed --- src/video/withStreamingServer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video/withStreamingServer.js b/src/video/withStreamingServer.js index 59c264d3e..b71ab63d1 100644 --- a/src/video/withStreamingServer.js +++ b/src/video/withStreamingServer.js @@ -30,7 +30,7 @@ function withStreamingServer(Video) { video.on(eventName, listener); } function dispatch(args) { - if (args && args.commandName === 'load') { + if (!destroyed && args && args.commandName === 'load') { stream = null; video.dispatch({ commandName: 'stop' }); if (args.commandArgs && args.commandArgs.stream && typeof args.commandArgs.stream.infoHash === 'string' && typeof args.commandArgs.streamingServerUrl === 'string') {