Mutagen-Modding / Mutagen

A .NET library for analyzing, creating, and manipulating Bethesda mods
GNU General Public License v3.0
118 stars 32 forks source link

QuestAdapterBinaryOverlay.VirtualMachineAdapter.Unknown throws IndexOutOfBounds #282

Open some1one opened 2 years ago

some1one commented 2 years ago

calling IQuestGetter.VirtualMachineAdapter.Unknown (actual type is QuestAdapterBinaryOverlay) throws an IndexOutOfBounds exceptions for many records. example record would be "10FAEC:Skyrim.esm". This is a problem because I don't want to just ignore VMAD but the at QuestAdapterCommon.Equals(IQuestAdapterGetter lhs, IQuestAdapterGetter rhs, TranslationCrystal crystal) method calls this getter.

An exception of type 'System.IndexOutOfRangeException' occurred in System.Private.CoreLib.dll but was not handled in user code: 'Index was outside the bounds of the array.'
   at System.ThrowHelper.ThrowIndexOutOfRangeException()
   at System.ReadOnlySpan`1.get_Item(Int32 index)
   at Mutagen.Bethesda.Skyrim.Internals.QuestAdapterBinaryOverlay.get_Unknown()
   at Mutagen.Bethesda.Skyrim.Internals.QuestAdapterCommon.Equals(IQuestAdapterGetter lhs, IQuestAdapterGetter rhs, TranslationCrystal crystal)
   at Mutagen.Bethesda.Skyrim.Internals.QuestCommon.Equals(IQuestGetter lhs, IQuestGetter rhs, TranslationCrystal crystal)
   at Mutagen.Bethesda.Skyrim.Internals.QuestCommon.Equals(IMajorRecordGetter lhs, IMajorRecordGetter rhs, TranslationCrystal crystal)
Noggog commented 2 years ago

Thanks for the report. Took a quick look at it, but this is more of a fundamental change in the generated code that needs to be looked at, so not a quick fix in one area. One my radar, but will be after some other queued up items like Fo4 parsing