Commit 3645d1ad authored by FORESTIER Fabien's avatar FORESTIER Fabien Committed by ncastejon
Browse files

Prevent error when a credit doesn't have a link

parent 6de6f672
......@@ -11,7 +11,7 @@
<div class="credit">
<div class="logo-content">
<a [href]="credit.links[0].url" target="_blank" *ngIf="credit.links[0]; else withoutLink">
<a [href]="credit.links[0].url" target="_blank" *ngIf="credit.links && credit.links[0]; else withoutLink">
<img [src]="credit.logo" [alt]="credit.name">
</a>
<ng-template #withoutLink>
......@@ -22,7 +22,8 @@
<p>{{credit.description}}</p>
<div class="bottom-section">
<a [href]="credit.links[0].url" i18n="@@credits.visitWebsite">Visit the website</a>
<a *ngIf="credit.links && credit.links[0]" [href]="credit.links[0].url" i18n="@@credits.visitWebsite">Visit
the website</a>
</div>
</div>
</div>
......
import { Component, OnInit } from '@angular/core';
import { OrganizationsService } from '../../services/organizations.service';
import { Organization, Credit } from '../../models';
import { ElasticsearchService, DatasetResearchService } from '../../../geosource/services';
import { Router } from '@angular/router';
import { Credit } from '../../models';
import { AppRoutes } from '../../../routes';
import { Aggregation } from '../../../geosource/models/filter.model';
import { scopesResearch } from '../../../geosource/models/scopes-research';
import { IPageHeaderInfo } from '../../../shared/models';
import { pageTitles, notificationMessages } from '../../../../i18n/traductions';
import { NotificationService } from '../../../core/services';
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment