Handled null piece exception in ChessModel.isValidMove