From 158a223d33f1be84cd9ea9a63095008c4ac18b96 Mon Sep 17 00:00:00 2001 From: binsky Date: Wed, 24 Mar 2021 21:13:27 +0100 Subject: [PATCH] catch saving a credential without label #657 --- js/app/controllers/edit_credential.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/js/app/controllers/edit_credential.js b/js/app/controllers/edit_credential.js index aa99bf14..64157534 100644 --- a/js/app/controllers/edit_credential.js +++ b/js/app/controllers/edit_credential.js @@ -314,6 +314,12 @@ $scope.storedCredential.custom_fields.push(angular.copy($scope.new_custom_field)); } + if ($scope.storedCredential.label === null || $scope.storedCredential.label.length === 0) { + $scope.saving = false; + NotificationService.showNotification($translate.instant('error.no.label'), 5000); + return; + } + if ($scope.storedCredential.password !== $scope.storedCredential.password_repeat){ $scope.saving = false; NotificationService.showNotification($translate.instant('password.do.not.match'), 5000); @@ -406,4 +412,4 @@ $location.path('/vault/' + $routeParams.vault_id); }; }]); -}()); \ No newline at end of file +}());