UmbraSpaceIndustries / MKS

MKS/OKS Colonization Systems
Other
221 stars 151 forks source link

Ore + ISRU Causes NRE in KolonyTools.StationView.DrawWindowContents #496

Closed lstanden closed 9 years ago

lstanden commented 9 years ago

The following simple fuel refinery breaks MKS 0.30.4 with Null Reference Exception every time.

Exception is as follows:

[EXC 14:25:59.284] NullReferenceException: Object reference not set to an instance of an object
    KolonyTools.MKSLExtensions+<>c__DisplayClass44+<>c__DisplayClass46.<GetProduction>b__3d (.ResourceRatio resRatio)
    System.Linq.Enumerable+<CreateSelectIterator>c__Iterator10`2[ResourceRatio,KolonyTools.MKSLresource].MoveNext ()
    System.Linq.Enumerable+<CreateSelectManyIterator>c__Iterator12`2[ModuleResourceConverter,KolonyTools.MKSLresource].MoveNext ()
    System.Linq.Enumerable+<CreateGroupByIterator>c__Iterator6`3[KolonyTools.MKSLresource,System.String,System.Double].MoveNext ()
    System.Linq.Enumerable+<CreateGroupByIterator>c__Iterator7`4[KolonyTools.MKSLresource,System.String,System.Double,KolonyTools.MKSLresource].MoveNext ()
    System.Collections.Generic.List`1[KolonyTools.MKSLresource].AddEnumerable (IEnumerable`1 enumerable)
    System.Collections.Generic.List`1[KolonyTools.MKSLresource]..ctor (IEnumerable`1 collection)
    System.Linq.Enumerable.ToList[MKSLresource] (IEnumerable`1 source)
    KolonyTools.StationView.DrawWindowContents (Int32 windowId)
    KolonyTools.Window`1[T].PreDrawWindowContents (Int32 windowId)
    UnityEngine.GUILayout+LayoutedWindow.DoWindow (Int32 windowID)
    UnityEngine.GUI.CallWindowDelegate (UnityEngine.WindowFunction func, Int32 id, UnityEngine.GUISkin _skin, Int32 forceRect, Single width, Single height, UnityEngine.GUIStyle style)

Steps to reproduce:

Versions:

lstanden commented 9 years ago

.craft which causes this problem:

https://gist.github.com/lstanden/1b6b649bbfc2fae8c2cc

Parts are just:

lstanden commented 9 years ago

Further testing shows this also breaks with the stock ore containers, so this isn't specific to Kontainers. That just happened to be what I had on my base when I encountered it.

BobPalmer commented 9 years ago

Fixed in next release