dwarfcorp
dwarfcorp copied to clipboard
Null reference while creating world preview texture [fairly common]
https://sentry.io/cfg/dwarfcorp/issues/772856984/?referrer=github_plugin
NullReferenceException: Object reference not set to an instance of an object.
File "C:\Users\matth\Desktop\dwarfcorp\DwarfCorp\DwarfCorpXNA\GameStates\WorldGeneration\WorldGeneratorPreview.cs", line 426, in RegneratePreviewTexture
Void RegneratePreviewTexture()
File "C:\Users\matth\Desktop\dwarfcorp\DwarfCorp\DwarfCorpXNA\GameStates\WorldGeneration\WorldGeneratorPreview.cs", line 576, in PreparePreview
Void PreparePreview(Microsoft.Xna.Framework.Graphics.GraphicsDevice)
File "C:\Users\matth\Desktop\dwarfcorp\DwarfCorp\DwarfCorpXNA\GameStates\WorldGeneration\WorldGeneratorState.cs", line 375, in Update
Void Update(DwarfCorp.DwarfTime)
File "C:\Users\matth\Desktop\dwarfcorp\DwarfCorp\DwarfCorpXNA\GameStates\GameStateManager.cs", line 132, in Update
Void Update(DwarfCorp.DwarfTime)
File "C:\Users\matth\Desktop\dwarfcorp\DwarfCorp\DwarfCorpXNA\DwarfGame.cs", line 728, in Update
Void Update(Microsoft.Xna.Framework.GameTime)
Object reference not set to an instance of an object.
This is a tough one. The function is too large to pinpoint what's null here. So I'm going to break up this function into smaller chunks so that future crashes are more localized. Options include the Overworld map being null, the graphics device being null, the world generator being null, and so on.
Broke up the function into parts to make localizing this crash easier in the future.
This means overworld.map is null just like in #1007 . Both of these bugs are pretty common, but I don't see a codepath that will make it happen.