Просмотр исходного кода

gui: Check that connection exists on event (fixes #7347) (#7348)

Simon Frei 5 лет назад
Родитель
Сommit
f1ec7fe55b

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

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