Browse Source

Check if module exists before using it in C code generator.

pull/1514/head
Joao Matos 5 years ago committed by João Matos
parent
commit
423b9a75cb
  1. 2
      src/Generator/Generators/C/CCodeGenerator.cs

2
src/Generator/Generators/C/CCodeGenerator.cs

@ -54,7 +54,7 @@ namespace CppSharp.Generators.C @@ -54,7 +54,7 @@ namespace CppSharp.Generators.C
public string QualifiedIdentifier(Declaration decl)
{
if (!string.IsNullOrEmpty(TranslationUnit.Module.OutputNamespace))
if (!string.IsNullOrEmpty(TranslationUnit.Module?.OutputNamespace))
{
if (string.IsNullOrEmpty(decl.QualifiedName))
return $"{decl.TranslationUnit.Module.OutputNamespace}";

Loading…
Cancel
Save