From 8a8a7e4152be3ca5a5a1bd75960f0e52daf30c0c Mon Sep 17 00:00:00 2001 From: Alex Martzios Date: Tue, 2 May 2023 12:47:49 +0300 Subject: [PATCH] fix an error for results without FoS --- landingPages/result/resultLanding.service.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/landingPages/result/resultLanding.service.ts b/landingPages/result/resultLanding.service.ts index 6b1e58e3..49c24532 100644 --- a/landingPages/result/resultLanding.service.ts +++ b/landingPages/result/resultLanding.service.ts @@ -312,9 +312,11 @@ export class ResultLandingService { this.resultLandingInfo.subjects = subjectResults[0]; this.resultLandingInfo.otherSubjects = subjectResults[1]; this.resultLandingInfo.classifiedSubjects = subjectResults[2]; - subjectResults[3].forEach(element => { - this.resultLandingInfo.fos.push({id: element, label: element.replace(/^\d+/, '').trim()}); - }); + if (subjectResults[3]) { + subjectResults[3].forEach(element => { + this.resultLandingInfo.fos.push({id: element, label: element.replace(/^\d+/, '').trim()}); + }); + } if (this.resultLandingInfo.fos) { this.resultLandingInfo.fos.sort((a, b) => a.id.localeCompare(b.id)); }