Commit bb1ccb7f authored by lynn's avatar lynn Committed by GitHub

fix: price chart crash when undefined price point (#4763)

fix price chart crash
parent 03fe90ad
...@@ -251,8 +251,10 @@ export function PriceChart({ width, height, prices }: PriceChartProps) { ...@@ -251,8 +251,10 @@ export function PriceChart({ width, height, prices }: PriceChartProps) {
pricePoint = x0.valueOf() - d0.timestamp.valueOf() > d1.timestamp.valueOf() - x0.valueOf() ? d1 : d0 pricePoint = x0.valueOf() - d0.timestamp.valueOf() > d1.timestamp.valueOf() - x0.valueOf() ? d1 : d0
} }
setCrosshair(timeScale(pricePoint.timestamp)) if (pricePoint) {
setDisplayPrice(pricePoint) setCrosshair(timeScale(pricePoint.timestamp))
setDisplayPrice(pricePoint)
}
}, },
[timeScale, prices] [timeScale, prices]
) )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment