Do nothing if the socket is not connected

This commit is contained in:
Gregoo 2025-01-18 18:28:42 +01:00
parent 7b682e5859
commit 5fa51c21a9

View File

@ -40,7 +40,7 @@ class BrickSocket {
if (this.html_button) {
this.add_listener = ((bricksocket) => (e) => {
if (!bricksocket.disabled) {
if (!bricksocket.disabled && bricksocket.socket !== undefined && bricksocket.socket.connected) {
bricksocket.toggle(false);
// Split and save the list if bulk