From 5f0d207fa5f122438ec50388cb19bf849f3fd98a Mon Sep 17 00:00:00 2001 From: Joao Matos Date: Wed, 31 Aug 2016 15:59:52 +0100 Subject: [PATCH] Fixed CheckDuplicatedNamesPass to check for null before using CurrentOutputNamespace. --- src/Generator/Passes/CheckDuplicatedNamesPass.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Generator/Passes/CheckDuplicatedNamesPass.cs b/src/Generator/Passes/CheckDuplicatedNamesPass.cs index f1fe437f..7316ca64 100644 --- a/src/Generator/Passes/CheckDuplicatedNamesPass.cs +++ b/src/Generator/Passes/CheckDuplicatedNamesPass.cs @@ -44,7 +44,9 @@ namespace CppSharp.Passes private bool UpdateName(Function function) { - Generator.CurrentOutputNamespace = function.TranslationUnit.Module.OutputNamespace; + if (function.TranslationUnit.Module != null) + Generator.CurrentOutputNamespace = function.TranslationUnit.Module.OutputNamespace; + var @params = function.Parameters.Where(p => p.Kind != ParameterKind.IndirectReturnType) .Select(p => p.QualifiedType.ToString()); // Include the conversion type in case of conversion operators