better prot against a previous bug

This commit is contained in:
Basile Burg 2016-07-06 06:52:17 +02:00
parent 16035ef8b3
commit 614f6bdc21
1 changed files with 7 additions and 6 deletions

View File

@ -417,23 +417,24 @@ var
str: string = '';
begin
clearTodoList;
if not exeInSysPath(ToolExeName) then
exit;
ctxt := getContext;
if ctxt = tcNone then
case ctxt of
tcNone: exit;
tcProject: if fProj = nil then exit;
tcFile: if fProj = nil then exit;
end;
if not exeInSysPath(ToolExeName) then
exit;
//
killToolProcess;
// process parameter
fToolProc := TCEProcess.Create(nil);
fToolProc.Executable := exeFullName(ToolExeName);
fToolProc.Options := [poUsePipes];
fToolProc.ShowWindow := swoHIDE;
fToolProc.CurrentDirectory := Application.ExeName.extractFileDir;
fToolProc.OnTerminate := @toolTerminated;
// files passed to the tool argument
if (ctxt = tcProject) and (fProj <> nil) then
if (ctxt = tcProject) then
begin
i := 0;
j := fProj.sourcesCount-1;