diff --git a/WolvenKit.CR2W/Types/Primitive/NetPrimitive/CEnum.cs b/WolvenKit.CR2W/Types/Primitive/NetPrimitive/CEnum.cs index f69089c9..530cb933 100644 --- a/WolvenKit.CR2W/Types/Primitive/NetPrimitive/CEnum.cs +++ b/WolvenKit.CR2W/Types/Primitive/NetPrimitive/CEnum.cs @@ -85,7 +85,7 @@ public override void Read(BinaryReader file, uint size) while (true) { var idx = file.ReadUInt16(); - if (idx == 0) + if (idx <= 0 || idx >= cr2w.names.Count) break; string s = cr2w.names[idx].Str; @@ -97,9 +97,12 @@ public override void Read(BinaryReader file, uint size) { var idx = file.ReadUInt16(); - string s = cr2w.names[idx].Str; + if (idx < cr2w.names.Count && idx >= 0) + { + string s = cr2w.names[idx].Str; - strings.Add(s); + strings.Add(s); + } } SetValue(strings);