From a554f209bd39c883fd184f28deb92e8c23f4cccc Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Sat, 29 Aug 2009 06:53:53 +0000 Subject: [PATCH] Fix unusable database tree after entering a regular expression with syntax errors into the filter combo. --- source/main.pas | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/source/main.pas b/source/main.pas index d25c9263..5034ddb4 100644 --- a/source/main.pas +++ b/source/main.pas @@ -6879,8 +6879,15 @@ begin for i:=0 to DatabasesWanted.Count-1 do begin rx.Expression := '^'+DatabasesWanted[i]+'$'; for j:=0 to AllDatabases.Count-1 do begin - if (Databases.IndexOf(AllDatabases[j]) = -1) and rx.Exec(AllDatabases[j]) then - Databases.Add(AllDatabases[j]); + if (Databases.IndexOf(AllDatabases[j]) = -1) then try + // The regular expression can have syntax errors which lead to an AV + if rx.Exec(AllDatabases[j]) then + Databases.Add(AllDatabases[j]); + comboOnlyDBs.Color := clWindow; + except + comboOnlyDBs.Color := clFuchsia; + break; + end; end; end; rx.Free;