From 6cdcf9622e79102c95702850872df5596d366f8d Mon Sep 17 00:00:00 2001 From: Matt Fiddaman Date: Sat, 1 Mar 2025 14:16:21 +0000 Subject: [PATCH] Bugfix/handle exception in benchmark service related to unnamed asset profiles (#4355) * Handle exception in benchmark service related to unnamed asset profiles * Update changelog --- CHANGELOG.md | 4 ++++ apps/api/src/services/benchmark/benchmark.service.ts | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a0610a839..c518d92f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Improved the symbol lookup in the _Trackinsight_ data enhancer for asset profile data +### Fixed + +- Handled an exception in the benchmark service related to unnamed asset profiles + ## 2.142.0 - 2025-02-28 ### Added diff --git a/apps/api/src/services/benchmark/benchmark.service.ts b/apps/api/src/services/benchmark/benchmark.service.ts index 57105da71..95cb9e5d2 100644 --- a/apps/api/src/services/benchmark/benchmark.service.ts +++ b/apps/api/src/services/benchmark/benchmark.service.ts @@ -133,7 +133,9 @@ export class BenchmarkService { symbol }; }) - .sort((a, b) => a.name.localeCompare(b.name)); + .sort((a, b) => { + return a.name?.localeCompare(b?.name) ?? 0; + }); } public async addBenchmark({