浏览代码

gui: Handle empty path in validation (ref #7379) (#7595)

Simon Frei 4 年之前
父节点
当前提交
60e8630413
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      gui/default/syncthing/core/pathIsSubDirDirective.js

+ 3 - 0
gui/default/syncthing/core/pathIsSubDirDirective.js

@@ -24,6 +24,9 @@ angular.module('syncthing.core')
                     scope.folderPathErrors.isParent = false;
                     scope.folderPathErrors.isParent = false;
                     scope.folderPathErrors.otherID = "";
                     scope.folderPathErrors.otherID = "";
                     scope.folderPathErrors.otherLabel = "";
                     scope.folderPathErrors.otherLabel = "";
+                    if (!viewValue) {
+                        return true;
+                    }
                     for (var folderID in scope.folders) {
                     for (var folderID in scope.folders) {
                         if (folderID === scope.currentFolder.id) {
                         if (folderID === scope.currentFolder.id) {
                             continue;
                             continue;