diff --git a/components/codetools/definetemplates.pas b/components/codetools/definetemplates.pas index ef06d6a99e..c824dc8a71 100644 --- a/components/codetools/definetemplates.pas +++ b/components/codetools/definetemplates.pas @@ -7580,8 +7580,9 @@ begin // run fpc and parse output RunFPCVerbose(Compiler,TestFilename,CfgFiles,RealCompiler,UnitPaths, Defines,Undefines,ExtraOptions); - for i:=0 to UnitPaths.Count-1 do - UnitPaths[i]:=ChompPathDelim(TrimFilename(UnitPaths[i])); + if UnitPaths<>nil then + for i:=0 to UnitPaths.Count-1 do + UnitPaths[i]:=ChompPathDelim(TrimFilename(UnitPaths[i])); // store the real compiler file and date if (RealCompiler<>'') and FileExistsCached(RealCompiler) then RealCompilerDate:=FileAgeCached(RealCompiler);