fix market price fetch in case symbols are missing

pull/239/head
Valentin Zickner 3 years ago committed by Thomas
parent ff15d5cbc4
commit ed731afc66

@ -172,9 +172,11 @@ export class PortfolioCalculator {
if (!marketSymbolMap[date]) {
marketSymbolMap[date] = {};
}
marketSymbolMap[date][marketSymbol.symbol] = new Big(
marketSymbol.marketPrice
);
if (marketSymbol.marketPrice) {
marketSymbolMap[date][marketSymbol.symbol] = new Big(
marketSymbol.marketPrice
);
}
}
let hasErrors = false;
@ -377,9 +379,11 @@ export class PortfolioCalculator {
if (!marketSymbolMap[date]) {
marketSymbolMap[date] = {};
}
marketSymbolMap[date][marketSymbol.symbol] = new Big(
marketSymbol.marketPrice
);
if (marketSymbol.marketPrice) {
marketSymbolMap[date][marketSymbol.symbol] = new Big(
marketSymbol.marketPrice
);
}
}
}

Loading…
Cancel
Save