Synthesis-Collective / SynthEBD

Port of zEBD to Mutagen
31 stars 7 forks source link

Another crash when pressing "run" #36

Closed Foroneus closed 2 years ago

Foroneus commented 2 years ago

SynthEBD has crashed with the following error: An object implementing IHandleObservableErrors (often a ReactiveCommand or ObservableAsPropertyHelper) has errored, thereby breaking its observable pipeline. To prevent this, ensure the pipeline does not error, or Subscribe to the ThrownExceptions property of the object in question to handle the erroneous case. at ReactiveUI.RxApp.<>cDisplayClass9_0.<.cctor>b2() in //src/ReactiveUI/RxApp.cs:line 109 at System.Reactive.Concurrency.Scheduler.Invoke(Action action) in //Rx.NET/Source/src/System.Reactive/Concurrency/Scheduler.Simple.cs:line 253 at System.Reactive.Concurrency.Scheduler.<>c.b740(IScheduler , Action a) in /_/Rx.NET/Source/src/System.Reactive/Concurrency/Scheduler.Simple.cs:line 37 at System.Reactive.Concurrency.DispatcherScheduler.<>cDisplayClass12_0`1.b_0() in //src/ReactiveUI.Uwp/Rx/Concurrency/DispatcherScheduler.cs:line 98 at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

Object reference not set to an instance of an object. at SynthEBD.Patcher.MainLoop(IEnumerable1 npcCollection, Boolean skipLinkedSecondaryNPCs, SkyrimMod outputMod, CategorizedFlattenedAssetPacks sortedAssetPacks, BodyGenConfigs bodyGenConfigs, Settings_OBody oBodySettings, HeightConfig currentHeightConfig, Int32 npcCounter, HashSet1 generatedLinkGroups, HashSet1 skippedLinkedNPCs, Keyword EBDFaceKW, Keyword EBDScriptKW, Spell bodySlideAssignmentSpell, HashSet1 headPartNPCs) in D:\a\SynthEBD\SynthEBD\SynthEBD\Patcher\Patcher.cs:line 300 at SynthEBD.Patcher.RunPatcher() in D:\a\SynthEBD\SynthEBD\SynthEBD\Patcher\Patcher.cs:line 139 at SynthEBD.VM_RunButton.<>c__DisplayClass2_0.<<-ctor>b__0>d.MoveNext() in D:\a\SynthEBD\SynthEBD\SynthEBD\RunButton\VM_RunButton.cs:line 48

Piranha91 commented 2 years ago

Hmm, will need some more information:

1) which asset config files are you using? Have you made any edits to them?

2) which body shape distribution mode are you using? If BodyGen, which config(s)? If OBody, do you have bodyslide presets installed?

3) do you have and specific NPC assignments or blocked NPC/plugin assignments?

4) have you made any modifications to the patcher’s height settings?

5) can you confirm which version of SynthEBD you’re running? The error log above says the problem is being triggered at patcher.cs/line 300, but in the latest version of the code that’s a blank line. But it might be a logging issue.

Edit: actually, in the latest release version that line is not blank. Could you check if the issue occurs on a vanilla load order? If not, you might have an NPC that has no EditorID.

Noggog commented 2 years ago

I think it might just be that EDID is not being checked for null on lines like https://github.com/Synthesis-Collective/SynthEBD/blob/master/SynthEBD/Patcher/Patcher.cs#L301

Piranha91 commented 2 years ago

Whoops, edited my post above before refreshing my browser and seeing yours. You’re right, that seems to be the issue. I’ll plug it… what kind of mod completely deletes the EditorID of a form? Lol

Noggog commented 2 years ago

Haha dunno. But there are lots of records with no EDIDs, such as PlacedObjects and such. So not unheard of, but probably rare for Npcs.

As per usual, I'd recommend considering adding <Nullable>enable</Nullable> to your csproj without turning them into errors. Would at least yellow highlight all the places like this a bit more to help notice in passing if there are other similar situations.

For example, L502 shows a yellow highlight when i turn it on, as indeed, there's a code route where templateMod might be null, it logs it, but then continues to run and might try to use templateMod anyway

Piranha91 commented 2 years ago

Yeah, I need to get around to handling all the null checks eventually. I just want to get feature complete first. Thanks for reminding me what the setting was; I was just about to ask.

Noggog commented 2 years ago

one last option you can do to ween yourself on is to turn on <WarningsAsErrors>nullable</WarningsAsErrors> which will barrage you with null ref errors.

For any files that are just too far gone, though, and you don't want to upgrade them, you can add #nullable disable to the top of that one file, and it'll shut up.

That way, you can keep your existing stuff as is without needing to refactor the world, while still learning the ropes on anything new you write

Foroneus commented 2 years ago
1. which asset config files are you using? Have you made any edits to them?

Multiple asset packs for The Pure, SNU, Masculine Argonian Textures, Pride of Valhalla, Sapphire's Overhauled Skin, Tempered Skins for Males, and The Pure.

  1. which body shape distribution mode are you using? If BodyGen, which config(s)? If OBody, do you have bodyslide presets installed? AutoBody, and I have many bodyslide presets
  2. do you have and specific NPC assignments or blocked NPC/plugin assignments? No.
  3. have you made any modifications to the patcher’s height settings? Yes, but only to disable the function entirely.
  4. can you confirm which version of SynthEBD you’re running? The error log above says the problem is being triggered at patcher.cs/line 300, but in the latest version of the code that’s a blank line. But it might be a logging issue. 0.7.8.2.
Piranha91 commented 2 years ago

Edit: Had a quick moment to test, looks like the new version also has an issue - I'll see if I can hammer it out tonight or over the weekend.

Piranha91 commented 2 years ago

This should now be fixed in 0.7.8.3. Thanks for the report.

Foroneus commented 2 years ago

Tried 0.7.8.5, and the problem does indeed seem to be fixed.