Browse Source

Fixed crash when file path of a unit was invalid.

pull/248/head
Elias Holzer 11 years ago
parent
commit
b1c5cb3bf3
  1. 2
      src/Generator/Generator.cs
  2. 5
      src/Generator/Passes/CleanUnitPass.cs

2
src/Generator/Generator.cs

@ -71,7 +71,7 @@ namespace CppSharp.Generators @@ -71,7 +71,7 @@ namespace CppSharp.Generators
if (!unit.IsGenerated || !unit.HasDeclarations)
continue;
if (unit.IsSystemHeader)
if (unit.IsSystemHeader || !unit.IsValid)
continue;
var templates = Generate(unit);

5
src/Generator/Passes/CleanUnitPass.cs

@ -18,10 +18,13 @@ namespace CppSharp.Passes @@ -18,10 +18,13 @@ namespace CppSharp.Passes
// Try to get an include path that works from the original include
// directories paths.
if (unit.IsValid)
{
unit.IncludePath = GetIncludePath(unit.FilePath);
return true;
}
return false;
}
string GetIncludePath(string filePath)
{

Loading…
Cancel
Save