jrossignol / ContractConfigurator

A config file based solution for creating new contracts for Kerbal Space Program.
https://forum.kerbalspaceprogram.com/index.php?/topic/91625-1
Other
64 stars 67 forks source link

NullReferenceException in ContractParameter.Update #695

Open lpgagnon opened 4 years ago

lpgagnon commented 4 years ago

Using CC 1.30.5. Don't know if it happened with previous version.

Seeing this on every scene change:

[ERR 11:48:28.059] [ContractParameter] - Call to OnUpdate failed System.NullReferenceException: Object reference not set to an instance of an object
  at ContractConfigurator.ContractVesselTracker+<>c__DisplayClass21_0.<GetAssociatedKeys>b__0 (System.Collections.Generic.KeyValuePair`2[TKey,TValue] p) [0x00007] in <ef0243a06f2841fe9bf57034a334902e>:0 
  at System.Linq.Enumerable+WhereSelectEnumerableIterator`2[TSource,TResult].MoveNext () [0x00037] in <fbb5ed17eb6e46c680000f8910ebb50c>:0 
  at ContractConfigurator.ContractVesselTracker+<GetAssociatedKeys>d__21.MoveNext () [0x000c1] in <ef0243a06f2841fe9bf57034a334902e>:0 
  at System.Linq.Enumerable+WhereEnumerableIterator`1[TSource].MoveNext () [0x0004e] in <fbb5ed17eb6e46c680000f8910ebb50c>:0 
  at System.Linq.Enumerable.Any[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x00015] in <fbb5ed17eb6e46c680000f8910ebb50c>:0 
  at ContractConfigurator.Parameters.Duration.OnUpdate () [0x000de] in <ef0243a06f2841fe9bf57034a334902e>:0 
  at Contracts.ContractParameter.Update () [0x00053] in <9d71e4043e394d78a6cf9193ad011698>:0 

This is a RP-1 install, I imagine this is getting triggered by something wrong in a particular contract. But presumably CC should at least handle it more gracefully, detecting the error and reporting it in a more meaningful way.

jrossignol commented 4 years ago

This doesn't look like it would've been caused by anything I did recently. Can you send your save file and I'll try to reproduce?

lpgagnon commented 4 years ago

warning, 60MB zip, 90MB .sfs (principia) https://drive.google.com/file/d/1XT1l5CdbBDZYYIH1432EIKF6f9hrjZXx/view?usp=sharing

I tried deleting all vessels to get a more reasonable size, but that made the exception go away. I expect that'll make reproduction problematic.

I don't relish the idea of binary-searching which vessel(s) might be triggering it...

jrossignol commented 4 years ago

Will hopefully look at this later tonight.... Principia and the huge file makes it pretty tough though, but hopefully I'll figure something out.