Check if description is set before replacing newlines

This commit is contained in:
brantje 2016-10-12 21:56:35 +02:00
parent 401da2bd55
commit 5e1b457c14
No known key found for this signature in database
GPG key ID: 5FF1D117F918687F

View file

@ -344,7 +344,9 @@
$scope.selectedCredential = false;
$scope.selectCredential = function (credential) {
credential.description_html = $sce.trustAsHtml(angular.copy(credential.description).replace("\n", '<br />'));
if(credential.description) {
credential.description_html = $sce.trustAsHtml(angular.copy(credential.description).replace("\n", '<br />'));
}
$scope.selectedCredential = angular.copy(credential);
$rootScope.$emit('app_menu', true);
};