Skip to content

Commit 16961d9

Browse files
committed
fix: crash in grid export dialog without active grid
1 parent b7dedc0 commit 16961d9

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎source/main.pas‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3698,6 +3698,9 @@ procedure TMainForm.actExportDataExecute(Sender: TObject);
36983698
ExportDialog: TfrmExportGrid;
36993699
begin
37003700
// Save data in current dataset into various text file formats
3701+
// ActiveGrid can be nil, e.g. on host tab, which crashed the export dialog
3702+
if ActiveGrid = nil then
3703+
Exit;
37013704
ExportDialog := TfrmExportGrid.Create(Self);
37023705
ExportDialog.Grid := ActiveGrid;
37033706
ExportDialog.ShowModal;
@@ -6726,7 +6729,7 @@ procedure TMainForm.ValidateControls(Sender: TObject);
67266729
actNextResult.Enabled := actPreviousResult.Enabled;
67276730

67286731
// Activate export-options if we're in any list control
6729-
actExportData.Enabled := HasConnection;
6732+
actExportData.Enabled := HasConnection and (ActiveGrid <> nil);
67306733
actDataSetNull.Enabled := HasConnection and inDataOrQueryTab and Assigned(Results) and Assigned(Grid.FocusedNode);
67316734

67326735
// Help only supported on regular MySQL and MariaDB servers

0 commit comments

Comments
 (0)