From 252fb3fe11465476b6a3c3a3e05aa4903db7f465 Mon Sep 17 00:00:00 2001 From: dandevaud <50833091+dandevaud@users.noreply.github.com> Date: Fri, 4 Oct 2024 19:49:03 +0200 Subject: [PATCH] Bugfix/Handle exception in historical market data gathering of derived currencies (#3858) * Handle exception in historical market data gathering of derived currencies * Update changelog --------- Co-authored-by: Dan --- CHANGELOG.md | 6 ++++++ .../services/data-provider/data-provider.service.ts | 10 +++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 88d89667b..00021fbfc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +### Fixed + +- Handled an exception in the historical market data gathering of derived currencies + ## 2.112.0 - 2024-10-03 ### Added diff --git a/apps/api/src/services/data-provider/data-provider.service.ts b/apps/api/src/services/data-provider/data-provider.service.ts index e5eda2d7e..bd20541af 100644 --- a/apps/api/src/services/data-provider/data-provider.service.ts +++ b/apps/api/src/services/data-provider/data-provider.service.ts @@ -666,9 +666,13 @@ export class DataProviderService { } = {}; for (const date in rootData) { - data[date] = { - marketPrice: new Big(factor).mul(rootData[date].marketPrice).toNumber() - }; + if (isNumber(rootData[date].marketPrice)) { + data[date] = { + marketPrice: new Big(factor) + .mul(rootData[date].marketPrice) + .toNumber() + }; + } } return data;