diff options
author | Raul Santos <raulsntos@gmail.com> | 2022-09-22 12:41:38 +0200 |
---|---|---|
committer | Raul Santos <raulsntos@gmail.com> | 2022-09-22 12:41:38 +0200 |
commit | f6d60764d3fe3887ccf0a3a0fe38b29fb9e6d068 (patch) | |
tree | d5bb9292d9b2c6b72bb66489b7a23ebf9ef9f3c1 /modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ExtensionMethods.cs | |
parent | 8e14f9ba21725a9445f3979742f2fc87c8a7b463 (diff) | |
download | redot-engine-f6d60764d3fe3887ccf0a3a0fe38b29fb9e6d068.tar.gz |
C#: Guard against null assemblies
A symbol's containing assembly will be null if the symbol is shared
across multiple assemblies.
Diffstat (limited to 'modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ExtensionMethods.cs')
-rw-r--r-- | modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ExtensionMethods.cs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ExtensionMethods.cs b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ExtensionMethods.cs index de3b6c862a..8de12de23b 100644 --- a/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ExtensionMethods.cs +++ b/modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/ExtensionMethods.cs @@ -29,7 +29,7 @@ namespace Godot.SourceGenerators { while (symbol != null) { - if (symbol.ContainingAssembly.Name == assemblyName && + if (symbol.ContainingAssembly?.Name == assemblyName && symbol.ToString() == typeFullName) { return true; @@ -47,7 +47,7 @@ namespace Godot.SourceGenerators while (symbol != null) { - if (symbol.ContainingAssembly.Name == "GodotSharp") + if (symbol.ContainingAssembly?.Name == "GodotSharp") return symbol; symbol = symbol.BaseType; |