mirror of https://github.com/ghostfolio/ghostfolio
Browse Source
When an activity's currency cannot be converted (no exchange rate for the currency/date), the converted fee and unit price arrive as null/NaN. Passing these to `new Big()` in the PortfolioCalculator constructor throws "[big.js] Invalid number" and aborts the whole calculation, so a single unconvertible activity fails the entire performance/details response with a 500. Add a `parseToBig` guard that defaults a missing/non-finite value to 0 and logs a warning, so the rest of the portfolio still renders. `quantity` is left as a direct `new Big()` because it is never currency-converted. Signed-off-by: martin <martin@0x01.local>pull/7002/head
1 changed files with 40 additions and 3 deletions
Loading…
Reference in new issue