Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Null reference while building voxel geometry. #1018

Open
mklingen opened this issue Mar 4, 2019 · 2 comments
Open

Null reference while building voxel geometry. #1018

mklingen opened this issue Mar 4, 2019 · 2 comments
Labels
A Bug High priority bug Crash

Comments

@mklingen
Copy link
Collaborator

mklingen commented Mar 4, 2019

https://sentry.io/organizations/cfg/issues/916167930/?project=192119&referrer=github_plugin

NullReferenceException: Object reference not set to an instance of an object.
  File "C:\Users\matth\Desktop\dwarfcorp\DwarfCorp\DwarfCorpXNA\Voxels\VoxelListPrimitive.cs", line 278, in BuildVoxelGeometry
    Void BuildVoxelGeometry(DwarfCorp.RawPrimitive, Int32, Int32, Int32, DwarfCorp.VoxelChunk, DwarfCorp.BoxPrimitive, Cache, DwarfCorp.DesignationSet, DwarfCorp.DesignationDrawer, DwarfCorp.WorldManager)
  File "C:\Users\matth\Desktop\dwarfcorp\DwarfCorp\DwarfCorpXNA\Voxels\VoxelListPrimitive.cs", line 232, in BuildSliceGeometry
    Void BuildSliceGeometry(DwarfCorp.VoxelChunk, DwarfCorp.BoxPrimitive, Cache, Int32, DwarfCorp.RawPrimitive, DwarfCorp.DesignationSet, DwarfCorp.DesignationDrawer, DwarfCorp.WorldManager)
  File "C:\Users\matth\Desktop\dwarfcorp\DwarfCorp\DwarfCorpXNA\Voxels\VoxelListPrimitive.cs", line 202, in InitializeFromChunk
    Void InitializeFromChunk(DwarfCorp.VoxelChunk, DwarfCorp.DesignationSet, DwarfCorp.DesignationDrawer, DwarfCorp.WorldManager)
  File "C:\Users\matth\Desktop\dwarfcorp\DwarfCorp\DwarfCorpXNA\Voxels\VoxelChunk.cs", line 164, in Rebuild
    Void Rebuild(Microsoft.Xna.Framework.Graphics.GraphicsDevice)
  File "C:\Users\matth\Desktop\dwarfcorp\DwarfCorp\DwarfCorpXNA\Voxels\ChunkManager.cs", line 311, in GenerateAllGeometry
    Void GenerateAllGeometry()
...
(1 additional frame(s) were not displayed)

Object reference not set to an instance of an object.
@mklingen mklingen added Crash A Bug High priority bug labels Mar 4, 2019
@mklingen
Copy link
Collaborator Author

mklingen commented Mar 4, 2019

Looking at this, somehow this is getting called with a null chunk. I broke up this function a bit to localize things, and I also added an exception early on to tell us if geometry is trying to get generated for a null chunk.

@mklingen
Copy link
Collaborator Author

mklingen commented Mar 4, 2019

the chunk simply can't be null here, it must be the slice geometry. Adding a bunch of asserts to slice building to get to the root of this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A Bug High priority bug Crash
Projects
None yet
Development

No branches or pull requests

1 participant