Fixed crash when trying to move king

variable p would be null before it hit the king piece and crash. Woo
crashes!