Skip to main content
added 16 characters in body
Source Link
Blau
  • 3.4k
  • 18
  • 19

I see three alternatives:

  • or blockList is null
  • or blocklist contains null values...
  • or blocklist contains values that are not of type block

I'd test with this code:

foreach (Block block in blockList) { if (block == null) { System.Diagnostics.Debugger.Break(); } block.Draw(spriteBatch); }

foreach (Block block in blockList)
{
  if (block == null)
  { 
      System.Diagnostics.Debugger.Break();
  }
  block.Draw(spriteBatch);
}

I see three alternatives:

  • or blockList is null
  • or blocklist contains null values...
  • or blocklist contains values that are not of type block

I'd test with this code:

foreach (Block block in blockList) { if (block == null) { System.Diagnostics.Debugger.Break(); } block.Draw(spriteBatch); }

I see three alternatives:

  • or blockList is null
  • or blocklist contains null values...
  • or blocklist contains values that are not of type block

I'd test with this code:

foreach (Block block in blockList)
{
  if (block == null)
  { 
      System.Diagnostics.Debugger.Break();
  }
  block.Draw(spriteBatch);
}
Source Link
Blau
  • 3.4k
  • 18
  • 19

I see three alternatives:

  • or blockList is null
  • or blocklist contains null values...
  • or blocklist contains values that are not of type block

I'd test with this code:

foreach (Block block in blockList) { if (block == null) { System.Diagnostics.Debugger.Break(); } block.Draw(spriteBatch); }