You forgot to initialize the array of cards:


public Deck()
{
Card[] cards = new Card[52];
// rest of code
}