-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unhandled exception running the Code generator against a C# class with no namespace #4
Comments
I would start by using an empty string in the null case and proceed from there. #define TWGShortened This_Will_Get_Shortened
|
The next place it falls over is in Net2ObjC.tt I tried changing CodeFacet.TypeNamespace to be an empty string instead of a null string if there is no namespace present, and that allowed the generation to succeed. |
You will have to account for the fact that the namespace is currently suffixed with a period. An empty namespace won't require that, |
I noticed this when trying to run the Dubrovnik.Generator.UI tool against a .NET library which exports a class that has no namespace defined.
The reflection part works ok, but then I get a NullReferenceException from http://www.github.com/ThesaurusSoftware/Dubrovnik/blob/master/dotNET/Dubrovnik.Tools/Dubrovnik.Tools/Net2ObjCPartial.cs#L1272 when doing the code gen step, as the 'managedIdentifier' parameter is a null string.
I'm not sure if the fix is just to return an empty string if managedIdentifier is null, or if it needs to handle that case differently.
The text was updated successfully, but these errors were encountered: