Everything was working fine on this game I am making, but now I started getting NullReferenceException errors on some of my code.
Here I define a Vector2 and a Texture2D:
Vector2 startButtonPosition;
Texture2D startButton;
And then in the Initialise() method:
startButtonPosition = new Vector2((graphics.GraphicsDevice.Viewport.Width - startButton.Width) / 2, 150);
When I run this, I get the NullReferenceException error on the startButtonPosition initialisation saying that the object reference was not set to an instance of an object. Yet it is.