From 59cee84015acde5e799606543cb178bea258c426 Mon Sep 17 00:00:00 2001 From: penev92 Date: Mon, 24 Oct 2022 06:34:27 +0300 Subject: [PATCH] Fixed code parsing throwing on invalid type cast This would be the case for older versions of the code and was identified in the RA2 repo. --- server/Oraide.Csharp/CodeParsers/RoslynCodeParser.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/Oraide.Csharp/CodeParsers/RoslynCodeParser.cs b/server/Oraide.Csharp/CodeParsers/RoslynCodeParser.cs index 034aff2..44ca873 100644 --- a/server/Oraide.Csharp/CodeParsers/RoslynCodeParser.cs +++ b/server/Oraide.Csharp/CodeParsers/RoslynCodeParser.cs @@ -81,7 +81,7 @@ public static (ILookup, if (member is FieldDeclarationSyntax fieldMember && fieldMember.Modifiers.Any(x => x.ValueText == "static") && fieldMember.Modifiers.Any(x => x.ValueText == "readonly") - && (fieldMember.Declaration.Type as GenericNameSyntax).Identifier.ValueText == "SpriteSequenceField") + && (fieldMember.Declaration.Type as GenericNameSyntax)?.Identifier.ValueText == "SpriteSequenceField") { foreach (var fieldInfo in ParseClassField(filePath, fileText, fieldMember)) {