Skip to content

Commit

Permalink
fix: Ignore types without namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
marklechtermann committed Nov 20, 2023
1 parent d5716bf commit f15102d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/dscom/writer/LibraryWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ private void CollectAllTypes()

foreach (var type in types)
{
if (type == null)
if (type == null || type.Namespace is null)
{
continue;
}
Expand Down Expand Up @@ -212,11 +212,11 @@ private void UpdateUniqueNames(Type type)
var searchExistingType = UniqueNames.FirstOrDefault(t => t.Key.Name == type.Name);
if (searchExistingType.Key != null)
{
var namesp = searchExistingType.Key.Namespace!;
var namesp = searchExistingType.Key.Namespace ?? string.Empty;
namesp = namesp.Replace(".", "_");
UniqueNames[searchExistingType.Key] = $"{namesp}_{searchExistingType.Key.Name}";

namesp = type.Namespace!;
namesp = type.Namespace ?? string.Empty;
namesp = namesp.Replace(".", "_");
UniqueNames.Add(type, $"{namesp}_{type.Name}");
}
Expand Down

0 comments on commit f15102d

Please sign in to comment.