mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-01-13 07:53:20 -05:00
Fixed unhandled exception that can occur when you close privacy bar
This commit is contained in:
parent
e7368b2fc2
commit
a1ac95bee4
@ -1395,14 +1395,27 @@ function createMeshCore(agent) {
|
|||||||
--this.desktop.kvm.connectionCount;
|
--this.desktop.kvm.connectionCount;
|
||||||
|
|
||||||
// Unpipe the web socket
|
// Unpipe the web socket
|
||||||
|
try
|
||||||
|
{
|
||||||
this.unpipe(this.httprequest.desktop.kvm);
|
this.unpipe(this.httprequest.desktop.kvm);
|
||||||
this.httprequest.desktop.kvm.unpipe(this);
|
this.httprequest.desktop.kvm.unpipe(this);
|
||||||
|
}
|
||||||
|
catch(xx)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
// Unpipe the WebRTC channel if needed (This will also be done when the WebRTC channel ends).
|
// Unpipe the WebRTC channel if needed (This will also be done when the WebRTC channel ends).
|
||||||
if (this.rtcchannel) {
|
if (this.rtcchannel)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
this.rtcchannel.unpipe(this.httprequest.desktop.kvm);
|
this.rtcchannel.unpipe(this.httprequest.desktop.kvm);
|
||||||
this.httprequest.desktop.kvm.unpipe(this.rtcchannel);
|
this.httprequest.desktop.kvm.unpipe(this.rtcchannel);
|
||||||
}
|
}
|
||||||
|
catch(xx)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Place wallpaper back if needed
|
// Place wallpaper back if needed
|
||||||
// TODO
|
// TODO
|
||||||
@ -1944,10 +1957,16 @@ function createMeshCore(agent) {
|
|||||||
this.websocket.rtcchannel.on('end', function () {
|
this.websocket.rtcchannel.on('end', function () {
|
||||||
// The WebRTC channel closed, unpipe the KVM now. This is also done when the web socket closes.
|
// The WebRTC channel closed, unpipe the KVM now. This is also done when the web socket closes.
|
||||||
//sendConsoleText('Tunnel #' + this.websocket.tunnel.index + ' WebRTC data channel closed');
|
//sendConsoleText('Tunnel #' + this.websocket.tunnel.index + ' WebRTC data channel closed');
|
||||||
if (this.websocket.desktop && this.websocket.desktop.kvm) {
|
if (this.websocket.desktop && this.websocket.desktop.kvm)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
this.unpipe(this.websocket.desktop.kvm);
|
this.unpipe(this.websocket.desktop.kvm);
|
||||||
this.websocket.httprequest.desktop.kvm.unpipe(this);
|
this.websocket.httprequest.desktop.kvm.unpipe(this);
|
||||||
}
|
}
|
||||||
|
catch (xx)
|
||||||
|
{ }
|
||||||
|
}
|
||||||
});
|
});
|
||||||
this.websocket.write('{\"ctrlChannel\":\"102938\",\"type\":\"webrtc0\"}'); // Indicate we are ready for WebRTC switch-over.
|
this.websocket.write('{\"ctrlChannel\":\"102938\",\"type\":\"webrtc0\"}'); // Indicate we are ready for WebRTC switch-over.
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user