Skip to content

Commit ddbd43a

Browse files
committed
[DSC-2059] Fix problem when authority is missing
1 parent aeabfb1 commit ddbd43a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/app/cris-layout/cris-layout-matrix/cris-layout-box-container/boxes/metadata/rendering-types/link-authority/link-authority.component.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { RenderingTypeValueModelComponent } from '../rendering-type-value.model'
88
import { Item } from '../../../../../../../core/shared/item.model';
99
import { LayoutField } from '../../../../../../../core/layout/models/box.model';
1010
import { MetadataValue } from '../../../../../../../core/shared/metadata.models';
11+
import { isEmpty } from '../../../../../../../shared/empty.util';
1112

1213
/**
1314
* This component renders the links metadata fields.
@@ -56,8 +57,11 @@ export class LinkAuthorityComponent extends RenderingTypeValueModelComponent imp
5657
}
5758

5859
getWebsiteIcon(): string {
59-
const siteUrl = this.metadataValue.authority;
6060
let iconStyle = '';
61+
const siteUrl = this.metadataValue.authority;
62+
if (isEmpty(siteUrl)) {
63+
return iconStyle;
64+
}
6165

6266
if (siteUrl.includes('linkedin')) {
6367
iconStyle = 'fab fa-linkedin';

0 commit comments

Comments
 (0)