diff --git a/components/lazcontrols/listfilteredit.pas b/components/lazcontrols/listfilteredit.pas index a044565876..e35e5ce5cf 100644 --- a/components/lazcontrols/listfilteredit.pas +++ b/components/lazcontrols/listfilteredit.pas @@ -173,6 +173,8 @@ var s: string; clb: TCustomCheckListBox; begin + if fFilteredListbox = nil then + exit; clb:=Nil; if fFilteredListbox is TCustomCheckListBox then clb:=TCustomCheckListBox(fFilteredListbox); @@ -197,6 +199,8 @@ procedure TListFilterEdit.StoreSelection; var i: Integer; begin + if fFilteredListbox = nil then + exit; fSelectionList.Clear; if fFilteredListbox.SelCount > 0 then for i := 0 to fFilteredListbox.Count-1 do diff --git a/components/lazcontrols/treefilteredit.pas b/components/lazcontrols/treefilteredit.pas index 7f0d55bb8d..caf0f6a62c 100644 --- a/components/lazcontrols/treefilteredit.pas +++ b/components/lazcontrols/treefilteredit.pas @@ -438,8 +438,10 @@ procedure TTreeFilterEdit.ApplyFilterCore; var i: Integer; begin + if fFilteredTreeview = nil then + exit; fFilteredTreeview.BeginUpdate; - if Assigned(fBranches) then begin // Apply filter for the brances + if Assigned(fBranches) then begin // Apply filter for the branches for i:=0 to fBranches.Count-1 do fBranches[i].ApplyFilter; end @@ -459,6 +461,8 @@ var ANode: TTreeNode; begin fSelectionList.Clear; + if fFilteredTreeview = nil then + exit; ANode:=fFilteredTreeview.Selected; while ANode<>nil do begin fSelectionList.Insert(0,ANode.Text);