diff --git a/components/tachart/tagraph.pas b/components/tachart/tagraph.pas index 38ec6c39d0..ba2eb76acf 100644 --- a/components/tachart/tagraph.pas +++ b/components/tachart/tagraph.pas @@ -2183,18 +2183,24 @@ end; procedure TBasicChartTool.Activate; begin - FChart.FActiveToolIndex := Index; - FChart.MouseCapture := true; - FChart.FDisablePopupMenu := false; - FStartMousePos := Mouse.CursorPos; + if Assigned(FChart) then + begin + FChart.FActiveToolIndex := Index; + FChart.MouseCapture := true; + FChart.FDisablePopupMenu := false; + FStartMousePos := Mouse.CursorPos; + end; end; procedure TBasicChartTool.Deactivate; begin - FChart.MouseCapture := false; - FChart.FActiveToolIndex := -1; - if PopupMenuConflict then - FChart.FDisablePopupMenu := true; + if Assigned(FChart) then + begin + FChart.MouseCapture := false; + FChart.FActiveToolIndex := -1; + if PopupMenuConflict then + FChart.FDisablePopupMenu := true; + end; end; function TBasicChartTool.PopupMenuConflict: Boolean; diff --git a/components/tachart/tatools.pas b/components/tachart/tatools.pas index 8ef49c944c..db9ec5e12f 100644 --- a/components/tachart/tatools.pas +++ b/components/tachart/tatools.pas @@ -2211,7 +2211,7 @@ begin ADrawer.SetXor(false); end; tdmNormal: - FChart.StyleChanged(Self); + if Assigned(FChart) then FChart.StyleChanged(Self); end; end;