mirror of
https://git.ryujinx.app/projects/Kenji-NX.git
synced 2026-09-30 01:08:01 +02:00
misc: chore: Fix possible System.NullReferenceExceptions
This commit is contained in:
@@ -39,7 +39,7 @@ namespace Ryujinx.HLE.Generators
|
||||
var type = constructors.Where(x => x.ParameterList.Parameters.Count == 2).FirstOrDefault().ParameterList.Parameters[1].Type;
|
||||
var model = context.Compilation.GetSemanticModel(type.SyntaxTree);
|
||||
var typeSymbol = model.GetSymbolInfo(type).Symbol as INamedTypeSymbol;
|
||||
var fullName = typeSymbol.ToString();
|
||||
var fullName = typeSymbol?.ToString();
|
||||
generator.EnterScope("if (parameter != null)");
|
||||
generator.AppendLine($"return new {GetFullName(className, context)}(context, ({fullName})parameter);");
|
||||
generator.LeaveScope();
|
||||
@@ -67,7 +67,7 @@ namespace Ryujinx.HLE.Generators
|
||||
{
|
||||
var typeSymbol = context.Compilation.GetSemanticModel(syntaxNode.SyntaxTree).GetDeclaredSymbol(syntaxNode);
|
||||
|
||||
return typeSymbol.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat);
|
||||
return typeSymbol?.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat);
|
||||
}
|
||||
|
||||
public void Initialize(GeneratorInitializationContext context)
|
||||
|
||||
Reference in New Issue
Block a user