From 48f1c064bc73d53a149406e82b8b189cfbf30e5f Mon Sep 17 00:00:00 2001 From: Abhishek Garg Date: Wed, 25 Feb 2026 14:50:36 -0500 Subject: [PATCH] Bugfix/handle X-ray rule exception when market price is missing (#6397) * Handle X-ray rule exception when market price is missing * Update changelog --- CHANGELOG.md | 6 ++++++ apps/api/src/models/rule.ts | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f806a260e..6b1a1c978 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 + +- Fixed an exception by adding a fallback for missing market price values on the _X-ray_ page + ## 2.243.0 - 2026-02-23 ### Changed diff --git a/apps/api/src/models/rule.ts b/apps/api/src/models/rule.ts index 9c27e0018..622375b5b 100644 --- a/apps/api/src/models/rule.ts +++ b/apps/api/src/models/rule.ts @@ -57,7 +57,7 @@ export abstract class Rule implements RuleInterface { previousValue + this.exchangeRateDataService.toCurrency( new Big(currentValue.quantity) - .mul(currentValue.marketPrice) + .mul(currentValue.marketPrice ?? 0) .toNumber(), currentValue.currency, baseCurrency