Skip to content

Commit 423b9a7

Browse files
committed
Check if module exists before using it in C code generator.
1 parent 62a58e4 commit 423b9a7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Generator/Generators/C/CCodeGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public virtual string QualifiedName(Declaration decl)
5454

5555
public string QualifiedIdentifier(Declaration decl)
5656
{
57-
if (!string.IsNullOrEmpty(TranslationUnit.Module.OutputNamespace))
57+
if (!string.IsNullOrEmpty(TranslationUnit.Module?.OutputNamespace))
5858
{
5959
if (string.IsNullOrEmpty(decl.QualifiedName))
6060
return $"{decl.TranslationUnit.Module.OutputNamespace}";

0 commit comments

Comments
 (0)