installer/UnitfrmMain.pas
changeset 274 4461dca354a5
parent 273 d4cdca1617c2
child 277 a50090ca6e6a
     1.1 --- a/installer/UnitfrmMain.pas	Mon Dec 18 20:26:31 2006 +0000
     1.2 +++ b/installer/UnitfrmMain.pas	Mon Dec 18 20:51:19 2006 +0000
     1.3 @@ -165,11 +165,13 @@
     1.4      eStr := TStringList.Create;
     1.5      ePath := '/';
     1.6      CurNode := trvDirectories.Selected;
     1.7 -    repeat
     1.8 -      ePath := '/' + CurNode.Text + ePath;
     1.9 -      CurNode := CurNode.Parent;
    1.10 -    until (not Assigned(CurNode));
    1.11 -    IdFTP.ChangeDir(ePath); 
    1.12 +    if (Assigned(CurNode)) then begin
    1.13 +      repeat
    1.14 +        ePath := '/' + CurNode.Text + ePath;
    1.15 +        CurNode := CurNode.Parent;
    1.16 +      until (not Assigned(CurNode));
    1.17 +    end;
    1.18 +    IdFTP.ChangeDir(ePath);
    1.19      IdFTP.List(eStr, '', False);
    1.20      if eStr.IndexOf('gameinfo.txt') = -1 then begin
    1.21        MessageBox(Handle, 'Invalid directory. Please select your mod directory and try again.', PChar(Application.Title), MB_ICONWARNING);