don't try to access empty string members

git-svn-id: trunk@14369 -
This commit is contained in:
paul 2008-03-03 02:54:00 +00:00
parent ab8d3d88f9
commit 7234fee1f0

View File

@ -1354,8 +1354,8 @@ begin
EndPos:=StartPos+length(NewPath);
end;
// check if path already exists
if FindPathInSearchPath(@Result[StartPos],EndPos-StartPos,
@Result[1],StartPos-1)<>nil
if (Length(Result) > 0) and
(FindPathInSearchPath(@Result[StartPos],EndPos-StartPos, @Result[1],StartPos-1) <> nil)
then begin
// remove path
System.Delete(Result,StartPos,EndPos-StartPos+1);