From bb65b8022c848ecf86806d56f1f574f7a8b8ea96 Mon Sep 17 00:00:00 2001 From: wp_xyz Date: Mon, 28 Nov 2022 19:14:48 +0100 Subject: [PATCH] TAChart: Fix TDataPointMarksClickTool crashing when series is empty. --- components/tachart/tatools.pas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/tachart/tatools.pas b/components/tachart/tatools.pas index 0a8908c191..0a4baa2383 100644 --- a/components/tachart/tatools.pas +++ b/components/tachart/tatools.pas @@ -2027,10 +2027,10 @@ begin for i := 0 to FChart.SeriesCount-1 do begin - if not (FChart.Series[i] is TBasicChartSeries) then + if not (FChart.Series[i] is TBasicPointSeries) then continue; ser := TBasicPointSeries(FChart.Series[i]); - if ser.Active and ser.IsPointInLabel(FChart.Drawer, APoint, FPointIndex, FYIndex) then + if ser.Active and (ser.Count > 0) and ser.IsPointInLabel(FChart.Drawer, APoint, FPointIndex, FYIndex) then begin FSeries := ser; FXIndex := 0; // to do: fix X index