1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

C#: Guard against null assemblies

A symbol's containing assembly will be null if the symbol is shared
across multiple assemblies.
This commit is contained in:
Raul Santos
2022-09-22 12:41:38 +02:00
parent 8e14f9ba21
commit f6d60764d3
2 changed files with 7 additions and 7 deletions

View File

@@ -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;