We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 87901b8 commit d43b0e5Copy full SHA for d43b0e5
projects/lib/src/chessplayer.cpp
@@ -260,8 +260,13 @@ void ChessPlayer::claimResult(const Chess::Result& result)
260
261
void ChessPlayer::forfeit(Chess::Result::Type type, const QString& description)
262
{
263
+ // If the board is gone, it means the game already ended and has an
264
+ // appropriate result.
265
+ if (m_board == nullptr)
266
+ return;
267
+
268
Chess::Side opp = m_side.opposite();
- if (!opp.isNull() && !board()->winPossible(opp))
269
+ if (!opp.isNull() && !m_board->winPossible(opp))
270
m_side = Chess::Side::NoSide;
271
272
if (m_side.isNull())
0 commit comments