gui: Prevent error without completion and nicer wrapping (fixes #4636)

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/4637
This commit is contained in:
Simon Frei
2018-01-05 14:41:40 +00:00
committed by Jakob Borg
parent 992bb0a98c
commit d87287c0d0
2 changed files with 2 additions and 2 deletions

View File

@@ -2054,7 +2054,7 @@ angular.module('syncthing.core')
resetRemoteNeed();
$scope.remoteNeedDevice = device;
$scope.deviceFolders(device).forEach(function(folder) {
if ($scope.completion[device.deviceID][folder].needItems === 0) {
if ($scope.completion[device.deviceID][folder] !== undefined && $scope.completion[device.deviceID][folder].needItems === 0) {
return;
}
$scope.remoteNeedFolders.push(folder);