Skip to content

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍

Bugfix/fix exception with currencies in historical market data editor of admin control panel (#4813)

Thomas Kaula11fef5e236d
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 55257d0151..35489f2289 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -20,6 +20,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Upgraded the _Stripe_ dependencies
- Upgraded `ngx-stripe` from version `19.0.0` to `19.7.0`
+### Fixed
+
+- Fixed an exception with currencies in the historical market data editor of the admin control panel
+
## 2.165.0 - 2025-05-31
### Added
diff --git a/apps/api/src/app/endpoints/market-data/market-data.controller.ts b/apps/api/src/app/endpoints/market-data/market-data.controller.ts
index 933e70e9da..96fca1b3c8 100644
--- a/apps/api/src/app/endpoints/market-data/market-data.controller.ts
+++ b/apps/api/src/app/endpoints/market-data/market-data.controller.ts
@@ -85,7 +85,7 @@ export class MarketDataController {
{ dataSource, symbol }
]);
- if (!assetProfile) {
+ if (!assetProfile && !isCurrency(getCurrencyFromSymbol(symbol))) {
throw new HttpException(
getReasonPhrase(StatusCodes.NOT_FOUND),
StatusCodes.NOT_FOUND
@@ -103,7 +103,7 @@ export class MarketDataController {
);
const canUpsertOwnAssetProfile =
- assetProfile.userId === this.request.user.id &&
+ assetProfile?.userId === this.request.user.id &&
hasPermission(
this.request.user.permissions,
permissions.createMarketDataOfOwnAssetProfile