@@ -7567,24 +7567,26 @@ procedure TMainForm.QuickFilterClick(Sender: TObject);
75677567 if ExecRegExpr('Prompt\d+$', Act.Name) then begin
75687568 // Item needs prompt
75697569 TableCol := SelectedTableFocusedColumn;
7570- Col := Conn.QuoteIdent(TableCol.Name, False);
7571-
7572- if (TableCol.DataType.Index = dbdtJson)
7573- and (Conn.Parameters.NetTypeGroup = ngPgSQL) then begin
7574- Col := Col + '::text';
7575- end;
7576- Val := DataGrid.Text[DataGrid.FocusedNode, DataGrid.FocusedColumn];
7577- if InputQuery(_('Specify filter-value...'), Act.Caption, Val) then begin
7578- if Act = actQuickFilterPrompt1 then
7579- Filter := Col + ' = ' + Conn.EscapeString(Val, TableCol.DataType)
7580- else if Act = actQuickFilterPrompt2 then
7581- Filter := Col + ' != ' + Conn.EscapeString(Val, TableCol.DataType)
7582- else if Act = actQuickFilterPrompt3 then
7583- Filter := Col + ' > ' + Conn.EscapeString(Val, TableCol.DataType)
7584- else if Act = actQuickFilterPrompt4 then
7585- Filter := Col + ' < ' + Conn.EscapeString(Val, TableCol.DataType)
7586- else if Act = actQuickFilterPrompt5 then
7587- Filter := Conn.SqlProvider.GetSql(qLikeCompare, [Col, Conn.EscapeString('%'+Val+'%', TableCol.DataType)]);
7570+ if Assigned(TableCol) then begin
7571+ Col := Conn.QuoteIdent(TableCol.Name, False);
7572+
7573+ if (TableCol.DataType.Index = dbdtJson)
7574+ and (Conn.Parameters.NetTypeGroup = ngPgSQL) then begin
7575+ Col := Col + '::text';
7576+ end;
7577+ Val := DataGrid.Text[DataGrid.FocusedNode, DataGrid.FocusedColumn];
7578+ if InputQuery(_('Specify filter-value...'), Act.Caption, Val) then begin
7579+ if Act = actQuickFilterPrompt1 then
7580+ Filter := Col + ' = ' + Conn.EscapeString(Val, TableCol.DataType)
7581+ else if Act = actQuickFilterPrompt2 then
7582+ Filter := Col + ' != ' + Conn.EscapeString(Val, TableCol.DataType)
7583+ else if Act = actQuickFilterPrompt3 then
7584+ Filter := Col + ' > ' + Conn.EscapeString(Val, TableCol.DataType)
7585+ else if Act = actQuickFilterPrompt4 then
7586+ Filter := Col + ' < ' + Conn.EscapeString(Val, TableCol.DataType)
7587+ else if Act = actQuickFilterPrompt5 then
7588+ Filter := Conn.SqlProvider.GetSql(qLikeCompare, [Col, Conn.EscapeString('%'+Val+'%', TableCol.DataType)]);
7589+ end;
75887590 end;
75897591 end
75907592 else begin
0 commit comments