diff --git a/FrostySdk/TypeLibrary.cs b/FrostySdk/TypeLibrary.cs index 11a078ba0..7f2baaa26 100644 --- a/FrostySdk/TypeLibrary.cs +++ b/FrostySdk/TypeLibrary.cs @@ -35,8 +35,15 @@ public static bool Initialize() for (int i = 0; i < s_types.Length; i++) { Type type = s_types[i]; + + NameHashAttribute? nameHashAttribute = type.GetCustomAttribute(); + if (nameHashAttribute is null) + { + // issue described in #25 we are just ignoring these cases + continue; + } + uint nameHash = nameHashAttribute.Hash; string name = type.GetCustomAttribute()?.Name ?? type.Name; - uint nameHash = type.GetCustomAttribute()!.Hash; // every type should have that attribute Guid? guid = type.GetCustomAttribute()?.Guid; s_nameMapping.Add(name, i);