mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-01-22 17:08:55 +00:00
Fix EquivalentValue crash on invalid tokens (#511)
This commit is contained in:
parent
4b3def2fce
commit
6cb0ebff5b
@ -36,10 +36,12 @@ export const fetchRates = (symbols: string[] = []): Promise<CCResponse> =>
|
||||
// to their respective rates via ETH.
|
||||
return symbols.reduce(
|
||||
(eqRates, sym) => {
|
||||
eqRates[sym] = rateSymbols.reduce((symRates, rateSym) => {
|
||||
symRates[rateSym] = 1 / rates[sym] * rates[rateSym];
|
||||
return symRates;
|
||||
}, {});
|
||||
if (rates[sym]) {
|
||||
eqRates[sym] = rateSymbols.reduce((symRates, rateSym) => {
|
||||
symRates[rateSym] = 1 / rates[sym] * rates[rateSym];
|
||||
return symRates;
|
||||
}, {});
|
||||
}
|
||||
return eqRates;
|
||||
},
|
||||
{
|
||||
|
@ -110,7 +110,7 @@ export default class EquivalentValues extends React.Component<Props, CmpState> {
|
||||
<option value="ETH">ETH</option>
|
||||
{tokenBalances &&
|
||||
tokenBalances.map(tk => {
|
||||
if (!tk.balance || tk.balance.isZero()) {
|
||||
if (!tk.balance || tk.balance.isZero() || !rates[tk.symbol]) {
|
||||
return;
|
||||
}
|
||||
const sym = tk.symbol;
|
||||
|
Loading…
x
Reference in New Issue
Block a user