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