From 3f0ca412c67d45b8de3f926e0f866f20435923a2 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Wed, 9 Nov 2016 21:49:15 -0500 Subject: [PATCH] index checking --- src/Web/wwwroot/app/vault/vaultController.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Web/wwwroot/app/vault/vaultController.js b/src/Web/wwwroot/app/vault/vaultController.js index f97ab17740..9357d106ff 100644 --- a/src/Web/wwwroot/app/vault/vaultController.js +++ b/src/Web/wwwroot/app/vault/vaultController.js @@ -127,7 +127,9 @@ apiService.sites.del({ id: site.id }, function () { var index = $scope.sites.indexOf(site); - $scope.sites.splice(index, 1); + if (index > -1) { + $scope.sites.splice(index, 1); + } }); }; @@ -174,7 +176,9 @@ apiService.folders.del({ id: folder.id }, function () { var index = $scope.folders.indexOf(folder); - $scope.folders.splice(index, 1); + if (index > -1) { + $scope.folders.splice(index, 1); + } }); };