From f1ec7fe55b24d749a85731d5b52476dc14e8f033 Mon Sep 17 00:00:00 2001 From: Simon Frei Date: Tue, 9 Feb 2021 12:37:35 +0100 Subject: [PATCH] gui: Check that connection exists on event (fixes #7347) (#7348) --- gui/default/syncthing/core/syncthingController.js | 3 +++ gui/default/untrusted/syncthing/core/syncthingController.js | 3 +++ 2 files changed, 6 insertions(+) diff --git a/gui/default/syncthing/core/syncthingController.js b/gui/default/syncthing/core/syncthingController.js index 4219f991d..7dbd09a1e 100755 --- a/gui/default/syncthing/core/syncthingController.js +++ b/gui/default/syncthing/core/syncthingController.js @@ -213,6 +213,9 @@ angular.module('syncthing.core') }); $scope.$on(Events.DEVICE_DISCONNECTED, function (event, arg) { + if (!$scope.connections[arg.data.id]) { + return; + } $scope.connections[arg.data.id].connected = false; refreshDeviceStats(); }); diff --git a/gui/default/untrusted/syncthing/core/syncthingController.js b/gui/default/untrusted/syncthing/core/syncthingController.js index f2f2696d3..cf1756602 100755 --- a/gui/default/untrusted/syncthing/core/syncthingController.js +++ b/gui/default/untrusted/syncthing/core/syncthingController.js @@ -213,6 +213,9 @@ angular.module('syncthing.core') }); $scope.$on(Events.DEVICE_DISCONNECTED, function (event, arg) { + if (!$scope.connections[arg.data.id]) { + return; + } $scope.connections[arg.data.id].connected = false; refreshDeviceStats(); });