From d2bdfcb1b78ad2d17e69bcf87a16d2f28de0f497 Mon Sep 17 00:00:00 2001 From: Damien <damien.burel@maarch.org> Date: Fri, 27 Dec 2019 17:36:42 +0100 Subject: [PATCH] FEAT #12091 TIME 0:20 Fix senders on process --- src/frontend/app/process/process.component.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/frontend/app/process/process.component.ts b/src/frontend/app/process/process.component.ts index 37826386d10..919cc2938ff 100755 --- a/src/frontend/app/process/process.component.ts +++ b/src/frontend/app/process/process.component.ts @@ -240,7 +240,10 @@ export class ProcessComponent implements OnInit { } loadSenders() { - if (this.currentResourceInformations.senders.length == 1) { + if (typeof this.currentResourceInformations.senders === "undefined" || this.currentResourceInformations.senders.length == 0) { + this.hasContact = false; + this.senderLightInfo = { 'displayName': this.lang.noSelectedContact, 'filling': null}; + } else if (this.currentResourceInformations.senders.length == 1) { this.hasContact = true; if (this.currentResourceInformations.senders[0].type == 'contact') { this.http.get('../../rest/contacts/' + this.currentResourceInformations.senders[0].id).pipe( @@ -271,9 +274,6 @@ export class ProcessComponent implements OnInit { } else if (this.currentResourceInformations.senders.length > 1) { this.hasContact = true; this.senderLightInfo = { 'displayName': this.currentResourceInformations.senders.length + ' ' + this.lang.senders, 'filling': null}; - } else { - this.hasContact = false; - this.senderLightInfo = { 'displayName': this.lang.noSelectedContact, 'filling': null}; } } -- GitLab