add try/catch

This commit is contained in:
Kum1ta
2024-11-21 14:28:29 +01:00
committed by tomoron
parent e971161d65
commit d1e938d5ec

View File

@ -133,7 +133,7 @@ class Screen
const canvas = this.canvasVideo; const canvas = this.canvasVideo;
const video = canvas.video; const video = canvas.video;
const texture = this.screen.material.map; const texture = this.screen.material.map;
try {
if (video) if (video)
{ {
video.pause(); video.pause();
@ -141,6 +141,9 @@ class Screen
video.removeAttribute('src'); video.removeAttribute('src');
video.load(); video.load();
} }
catch {
// Do nothing
}
if (texture) if (texture)
texture.dispose(); texture.dispose();
canvas.video = null; canvas.video = null;