Skip to content

Commit

Permalink
Null check to prevent crasher
Browse files Browse the repository at this point in the history
  • Loading branch information
daylen committed Feb 12, 2014
1 parent 0033b34 commit aad3602
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Stockfish/SFMWindowController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ - (IBAction)doBestMove:(id)sender
#pragma mark - Helper methods
- (void)syncModelWithView
{
if (self.currentGame.currPosition == NULL) {
@throw [NSException exceptionWithName:@"NullPositionException" reason:@"Position is null." userInfo:nil];
}
self.boardView.position->copy(*self.currentGame.currPosition);
[self.boardView updatePieceViews];
[self.boardView clearArrows];
Expand Down

0 comments on commit aad3602

Please sign in to comment.