Closed Kubrix closed 2 months ago
public class Game1 :Game { ComboBox CbShootMode; } protected override void LoadContent() { CbShootMode = new ComboBox(); CbShootMode.Items.Add(new ListItem("Manual", Color.Black)); CbShootMode.Items.Add(new ListItem("Auto", Color.Black)); CbShootMode.Left = 185; CbShootMode.Top= 50; grid.Widgets.Add(CbShootMode); } protected override void Draw(GameTime gameTime) { CbShootMode.Visible = (CurGameState == GameState.Options); _spriteBatch.Begin(); _desktop.Render(); }
On CbShootMode.Visible = CurGameState == GameState.Options:
System.NullReferenceException: 'Object reference not set to an instance of an object.'
CbShootMode was null.
I think the real code differs from the one provided in this issue. As CbShootMode can't be null in such case.
Seems to be gone after studio restart and rebuild
On CbShootMode.Visible = CurGameState == GameState.Options:
System.NullReferenceException: 'Object reference not set to an instance of an object.'
CbShootMode was null.