mirror of https://github.com/ghostfolio/ghostfolio
Browse Source
When exchange rate data is unavailable (e.g. on a fresh install before the data gathering job completes), toCurrencyAtDate() returned undefined. This propagated into new Big(undefined) in PortfolioCalculator and into number accumulations in PortfolioService, crashing the Overview, Portfolio and Holdings pages with "[big.js] Invalid number". Return 0 instead of undefined from toCurrencyAtDate() when no exchange rate can be found, consistent with the existing pattern in #6397. Add defensive ?? 0 guards at call sites in ActivitiesService and PortfolioService for additional safety. The error log is preserved so missing exchange rates are still flagged in the server logs without crashing the frontend. Fixes #6482pull/6574/head
3 changed files with 33 additions and 31 deletions
Loading…
Reference in new issue