dwarfcorp icon indicating copy to clipboard operation
dwarfcorp copied to clipboard

Null reference while creating dwarf sprite (source parameter) [extremely rare]

Open mklingen opened this issue 5 years ago • 1 comments

https://sentry.io/cfg/dwarfcorp/issues/885777624/?referrer=github_plugin

TargetInvocationException: Exception has been thrown by the target of an invocation.
  File "C:\Users\matth\Desktop\dwarfcorp\DwarfCorp\DwarfCorpXNA\Entities\EntityFactory.cs", line 88, in Initialize { <lambda> }
    DwarfCorp.GameComponent <Initialize>b__1(Microsoft.Xna.Framework.Vector3, DwarfCorp.Blackboard)
  File "C:\Users\matth\Desktop\dwarfcorp\DwarfCorp\DwarfCorpXNA\Entities\EntityFactory.cs", line 106, in CreateEntity
    T CreateEntity[T](System.String, Microsoft.Xna.Framework.Vector3, DwarfCorp.Blackboard)
  File "C:\Users\matth\Desktop\dwarfcorp\DwarfCorp\DwarfCorpXNA\World\WorldManager-NewGameSetup.cs", line 54, in CreateInitialDwarves
    Void CreateInitialDwarves(Microsoft.Xna.Framework.Vector3)
  File "C:\Users\matth\Desktop\dwarfcorp\DwarfCorp\DwarfCorpXNA\World\WorldManager-NewGameSetup.cs", line 88, in CreateInitialEmbarkment
    Void CreateInitialEmbarkment()
  File "C:\Users\matth\Desktop\dwarfcorp\DwarfCorp\DwarfCorpXNA\World\WorldManager-Loading.cs", line 432, in LoadThreaded
    Void LoadThreaded()
...
(3 additional frame(s) were not displayed)

ArgumentNullException: Value cannot be null.
Parameter name: source
  File "C:\Users\matth\Desktop\dwarfcorp\DwarfCorp\DwarfCorpXNA\Entities\Dwarves\Dwarf.cs", line 195, in CreateDwarfSprite
    Void CreateDwarfSprite(DwarfCorp.EmployeeClass, DwarfCorp.ComponentManager)
  File "C:\Users\matth\Desktop\dwarfcorp\DwarfCorp\DwarfCorpXNA\Entities\Dwarves\Dwarf.cs", line 124, in CreateCosmeticChildren
    Void CreateCosmeticChildren(DwarfCorp.ComponentManager)
  File "C:\Users\matth\Desktop\dwarfcorp\DwarfCorp\DwarfCorpXNA\Entities\Dwarves\Dwarf.cs", line 73, in .ctor
    Void .ctor(DwarfCorp.ComponentManager, DwarfCorp.CreatureStats, System.String, DwarfCorp.PlanService, DwarfCorp.Faction, System.String, DwarfCorp.EmployeeClass, Microsoft.Xna.Framework.Vector3)
  File "C:\Users\matth\Desktop\dwarfcorp\DwarfCorp\DwarfCorpXNA\Entities\Dwarves\DwarfFactory.cs", line 91, in GenerateDwarf
    DwarfCorp.GameComponent GenerateDwarf(Microsoft.Xna.Framework.Vector3, DwarfCorp.ComponentManager, System.String, DwarfCorp.EmployeeClass, Int32, DwarfCorp.Gender, Int32)
  File "C:\Users\matth\Desktop\dwarfcorp\DwarfCorp\DwarfCorpXNA\Entities\Dwarves\DwarfFactory.cs", line 50, in __factory0
    DwarfCorp.GameComponent __factory0(DwarfCorp.ComponentManager, Microsoft.Xna.Framework.Vector3, DwarfCorp.Blackboard)
...
(1 additional frame(s) were not displayed)

Exception has been thrown by the target of an invocation.

mklingen avatar Feb 16 '19 23:02 mklingen

It looks like the dwarf layer library is not loading. I could see this happening if the graphics device was lost at a very, very bad moment. I don't see anyway to recover unfortunately... and honestly can't see why it's crashing instead of just being empty.

Blecki avatar Feb 17 '19 01:02 Blecki