Severity: Medium
Source
app/components/trade/TradingChart.tsx:741-755
Description
hasVolumeData only checks (c.volume ?? 0) > 0. If external candle data contains NaN or Infinity in the volume field (e.g., a corrupt API response), the value passes directly into volumeSeries.setData():
volumeSeries.setData(formatted.map((c) => ({
time: c.time,
value: c.volume ?? 0, // NaN/Infinity passes through unchecked
color: '...',
})));
Some versions of lightweight-charts throw synchronously when receiving NaN/Infinity data, crashing the React tree.
Fix
Add Number.isFinite guard:
value: Number.isFinite(c.volume) ? c.volume : 0,
Severity: Medium
Source
app/components/trade/TradingChart.tsx:741-755Description
hasVolumeDataonly checks(c.volume ?? 0) > 0. If external candle data containsNaNorInfinityin the volume field (e.g., a corrupt API response), the value passes directly intovolumeSeries.setData():Some versions of lightweight-charts throw synchronously when receiving NaN/Infinity data, crashing the React tree.
Fix
Add
Number.isFiniteguard: