Skip to content
Snippets Groups Projects
Commit dae41031 authored by Brian Peiris's avatar Brian Peiris
Browse files

add guards for uninitialized objects when exiting

parent 2511f075
No related branches found
No related tags found
No related merge requests found
......@@ -195,10 +195,16 @@ const onReady = async () => {
if (NAF.connection.adapter && NAF.connection.adapter.localMediaStream) {
NAF.connection.adapter.localMediaStream.getTracks().forEach(t => t.stop());
}
hubChannel.disconnect();
if (hubChannel) {
hubChannel.disconnect();
}
const scene = document.querySelector("a-scene");
scene.renderer.animate(null); // Stop animation loop, TODO A-Frame should do this
document.body.removeChild(scene);
if (scene) {
if (scene.renderer) {
scene.renderer.animate(null); // Stop animation loop, TODO A-Frame should do this
}
document.body.removeChild(scene);
}
};
const enterScene = async (mediaStream, enterInVR, janusRoomId) => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment