From 49b49dd7e0244210c200da8b7bb8e16ed911f950 Mon Sep 17 00:00:00 2001 From: juha Date: Sun, 20 Mar 2011 16:37:09 +0000 Subject: [PATCH] IDE: fixed access violation in InitialSetupDlg when path is not valid git-svn-id: trunk@29932 - --- ide/initialsetupdlgs.pas | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ide/initialsetupdlgs.pas b/ide/initialsetupdlgs.pas index 26ded29957..55c7b3c4e7 100644 --- a/ide/initialsetupdlgs.pas +++ b/ide/initialsetupdlgs.pas @@ -1275,9 +1275,9 @@ begin if Dirs<>nil then begin i:=Dirs.Count-1; while (i>=0) and (TSDFileInfo(Dirs[i]).Caption<>Result) do dec(i); + if i>=0 then + Result:=TSDFileInfo(Dirs[i]).Filename; end; - if i>=0 then - Result:=TSDFileInfo(Dirs[i]).Filename; Result:=ChompPathDelim(TrimFilename(Result)); if Result<>'' then Result:=ChompPathDelim(TrimFilename(ExpandFileNameUTF8(Result))); @@ -1293,9 +1293,9 @@ begin if Dirs<>nil then begin i:=Dirs.Count-1; while (i>=0) and (TSDFileInfo(Dirs[i]).Caption<>Result) do dec(i); + if i>=0 then + Result:=TSDFileInfo(Dirs[i]).Filename; end; - if i>=0 then - Result:=TSDFileInfo(Dirs[i]).Filename; Result:=TrimFilename(Result); end; @@ -1309,9 +1309,9 @@ begin if Dirs<>nil then begin i:=Dirs.Count-1; while (i>=0) and (TSDFileInfo(Dirs[i]).Caption<>Result) do dec(i); + if i>=0 then + Result:=TSDFileInfo(Dirs[i]).Filename; end; - if i>=0 then - Result:=TSDFileInfo(Dirs[i]).Filename; Result:=ChompPathDelim(TrimFilename(Result)); end;