mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 16:00:16 +02:00
IDE: fixed access violation in InitialSetupDlg when path is not valid
git-svn-id: trunk@29932 -
This commit is contained in:
parent
9b84e49668
commit
49b49dd7e0
@ -1275,9 +1275,9 @@ begin
|
|||||||
if Dirs<>nil then begin
|
if Dirs<>nil then begin
|
||||||
i:=Dirs.Count-1;
|
i:=Dirs.Count-1;
|
||||||
while (i>=0) and (TSDFileInfo(Dirs[i]).Caption<>Result) do dec(i);
|
while (i>=0) and (TSDFileInfo(Dirs[i]).Caption<>Result) do dec(i);
|
||||||
end;
|
|
||||||
if i>=0 then
|
if i>=0 then
|
||||||
Result:=TSDFileInfo(Dirs[i]).Filename;
|
Result:=TSDFileInfo(Dirs[i]).Filename;
|
||||||
|
end;
|
||||||
Result:=ChompPathDelim(TrimFilename(Result));
|
Result:=ChompPathDelim(TrimFilename(Result));
|
||||||
if Result<>'' then
|
if Result<>'' then
|
||||||
Result:=ChompPathDelim(TrimFilename(ExpandFileNameUTF8(Result)));
|
Result:=ChompPathDelim(TrimFilename(ExpandFileNameUTF8(Result)));
|
||||||
@ -1293,9 +1293,9 @@ begin
|
|||||||
if Dirs<>nil then begin
|
if Dirs<>nil then begin
|
||||||
i:=Dirs.Count-1;
|
i:=Dirs.Count-1;
|
||||||
while (i>=0) and (TSDFileInfo(Dirs[i]).Caption<>Result) do dec(i);
|
while (i>=0) and (TSDFileInfo(Dirs[i]).Caption<>Result) do dec(i);
|
||||||
end;
|
|
||||||
if i>=0 then
|
if i>=0 then
|
||||||
Result:=TSDFileInfo(Dirs[i]).Filename;
|
Result:=TSDFileInfo(Dirs[i]).Filename;
|
||||||
|
end;
|
||||||
Result:=TrimFilename(Result);
|
Result:=TrimFilename(Result);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1309,9 +1309,9 @@ begin
|
|||||||
if Dirs<>nil then begin
|
if Dirs<>nil then begin
|
||||||
i:=Dirs.Count-1;
|
i:=Dirs.Count-1;
|
||||||
while (i>=0) and (TSDFileInfo(Dirs[i]).Caption<>Result) do dec(i);
|
while (i>=0) and (TSDFileInfo(Dirs[i]).Caption<>Result) do dec(i);
|
||||||
end;
|
|
||||||
if i>=0 then
|
if i>=0 then
|
||||||
Result:=TSDFileInfo(Dirs[i]).Filename;
|
Result:=TSDFileInfo(Dirs[i]).Filename;
|
||||||
|
end;
|
||||||
Result:=ChompPathDelim(TrimFilename(Result));
|
Result:=ChompPathDelim(TrimFilename(Result));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user