From 5e1b457c14486ee22c96f541d674874b3a09aa46 Mon Sep 17 00:00:00 2001 From: brantje Date: Wed, 12 Oct 2016 21:56:35 +0200 Subject: [PATCH] Check if description is set before replacing newlines --- js/app/controllers/credential.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/app/controllers/credential.js b/js/app/controllers/credential.js index 1e3629f7..579f3e91 100644 --- a/js/app/controllers/credential.js +++ b/js/app/controllers/credential.js @@ -344,7 +344,9 @@ $scope.selectedCredential = false; $scope.selectCredential = function (credential) { - credential.description_html = $sce.trustAsHtml(angular.copy(credential.description).replace("\n", '
')); + if(credential.description) { + credential.description_html = $sce.trustAsHtml(angular.copy(credential.description).replace("\n", '
')); + } $scope.selectedCredential = angular.copy(credential); $rootScope.$emit('app_menu', true); };