diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f5fae02f..2ca0f9fbd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Upgraded `http-status-codes` from version `2.2.0` to `2.3.0` +### Fixed + +- Handled reading items from missing transaction point while getting the position (`getPosition()`) in portfolio service + ## 2.24.0 - 2023-11-16 ### Changed diff --git a/apps/api/src/app/portfolio/portfolio.service.ts b/apps/api/src/app/portfolio/portfolio.service.ts index 525273253..2a701aab5 100644 --- a/apps/api/src/app/portfolio/portfolio.service.ts +++ b/apps/api/src/app/portfolio/portfolio.service.ts @@ -879,7 +879,7 @@ export class PortfolioService { let currentAveragePrice = 0; let currentQuantity = 0; - const currentSymbol = transactionPoints[j].items.find( + const currentSymbol = transactionPoints[j]?.items.find( ({ symbol }) => { return symbol === aSymbol; }