SpriteBatch.end() generating null pointer exception
- by odaymichael
I am getting a null pointer exception using libGDX that the debugger points as the SpriteBatch.end() line. I was wondering what would cause this.
Here is the offending code block, specifically the batch.end() line:
batch.begin();
for (int j = 0; j < 3; j++)
for (int i = 0; i < 3; i++)
if (zoomgrid[i][j].getPiece().getImage() != null)
zoomgrid[i][j].getPiece().getImage().draw(batch);
batch.end();
The top of the stack is actually a line that calls
lastTexture.bind();
In the flush() method of com.badlogic.gdx.graphics.g2d.SpriteBatch.
I appreciate any input, let me know if I haven't included enough information.