瀏覽代碼

Handle null case for invalid ng-model value (fixes #2392)

Invalid ng-model value is assigned `null` by angular.js which is being matched as `object`, thus disappear in the UI when a minus sign is entered.
Benny Ng 9 年之前
父節點
當前提交
24023ff9e8
共有 3 個文件被更改,包括 5 次插入0 次删除
  1. 1 0
      AUTHORS
  2. 1 0
      NICKS
  3. 3 0
      gui/default/syncthing/core/syncthingController.js

+ 1 - 0
AUTHORS

@@ -13,6 +13,7 @@ Bart De Vries <[email protected]>
 Ben Curthoys <[email protected]>
 Ben Schulz <[email protected]> <[email protected]>
 Ben Sidhom <[email protected]>
+Benny Ng <[email protected]>
 Brandon Philips <[email protected]>
 Brendan Long <[email protected]>
 Brian R. Becker <[email protected]>

+ 1 - 0
NICKS


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

@@ -1531,6 +1531,9 @@ angular.module('syncthing.core')
             if (key.substr(0, 1) === '_') {
                 return 'skip';
             }
+            if (value === null) {
+                return 'null';
+            }
             if (typeof value === 'number') {
                 return 'number';
             }