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 = ''; str: string = '';
begin begin
clearTodoList; clearTodoList;
if not exeInSysPath(ToolExeName) then
exit;
ctxt := getContext; 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; exit;
// //
killToolProcess; killToolProcess;
// process parameter
fToolProc := TCEProcess.Create(nil); fToolProc := TCEProcess.Create(nil);
fToolProc.Executable := exeFullName(ToolExeName); fToolProc.Executable := exeFullName(ToolExeName);
fToolProc.Options := [poUsePipes]; fToolProc.Options := [poUsePipes];
fToolProc.ShowWindow := swoHIDE; fToolProc.ShowWindow := swoHIDE;
fToolProc.CurrentDirectory := Application.ExeName.extractFileDir; fToolProc.CurrentDirectory := Application.ExeName.extractFileDir;
fToolProc.OnTerminate := @toolTerminated; fToolProc.OnTerminate := @toolTerminated;
// files passed to the tool argument // files passed to the tool argument
if (ctxt = tcProject) and (fProj <> nil) then if (ctxt = tcProject) then
begin begin
i := 0; i := 0;
j := fProj.sourcesCount-1; j := fProj.sourcesCount-1;