fix #300 - Error while finding the common directory and if all the sources dont have a module declaration

This commit is contained in:
Basile Burg 2018-04-21 10:39:57 +02:00
parent b4d8e191a7
commit bc0dc31b0d
1 changed files with 9 additions and 1 deletions

View File

@ -243,7 +243,15 @@ begin
end;
end;
deleteDups(lst);
if project.sourcesCount = 0 then
// issue 300 when no moduleDeclaration lst can be empty
if (lst.Count = 0) and (project.sourcesCount > 0) then
begin
for i := 0 to project.sourcesCount-1 do
lst.Add(project.sourceAbsolute(i));
result := commonFolder(lst);
result := result.extractFileDir;
end
else if (project.sourcesCount = 0) then
result := ''
else
begin