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(); });