Skip to content

Commit 0c900b4

Browse files
committed
fix: crash on right-click in empty area of query result grid
Closes #2056
1 parent b1ae97a commit 0c900b4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

source/main.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3666,7 +3666,7 @@ procedure TMainForm.actDataPreviewUpdate(Sender: TObject);
36663666
// Enable or disable ImageView action
36673667
Grid := ActiveGrid;
36683668
(Sender as TAction).Enabled := (Grid <> nil)
3669-
and (Grid.FocusedColumn-1 <> NoColumn)
3669+
and (Grid.FocusedColumn > 0) // may be NoColumn/-1 or InvalidColumn/-2
36703670
and (GridResult(Grid).DataType(Grid.FocusedColumn-1).Category = dtcBinary)
36713671
end;
36723672

0 commit comments

Comments
 (0)