diff --git a/Compiler/PCU/PCUReader.cs b/Compiler/PCU/PCUReader.cs index 48a5cf4f2..8abcc9cc2 100644 --- a/Compiler/PCU/PCUReader.cs +++ b/Compiler/PCU/PCUReader.cs @@ -268,6 +268,7 @@ namespace PascalABCCompiler.PCU if (NeedRecompiled()) { CloseUnit(); + this.unit = null; need = true; return null; // return comp.RecompileUnit(FileName); } @@ -363,6 +364,7 @@ namespace PascalABCCompiler.PCU if (already_compiled[used_unit_fname] == null) { var sub_u = pr.GetCompilationUnit(used_unit_fname, this.readDebugInfo); + if (sub_u == null) return true; this.unit.DirectInterfaceCompilationUnits.Add(sub_u.SemanticTree, sub_u); this.unit.InterfaceUsedUnits.AddElement(sub_u.SemanticTree, pcu_file.incl_modules[i]); }