Commit 17e9ddaa authored by Denis Kuplyakov's avatar Denis Kuplyakov
Browse files

Corrected setGame code to properly handle setting of NULL game.

Simply added "if (m_game)" check to not try to connect to NULL pointer
parent 3516738f
......@@ -56,11 +56,14 @@ void KReversiView::setGame(KReversiGame *game)
m_game = game;
connect(m_game, SIGNAL(boardChanged()), this, SLOT(updateBoard()));
connect(m_game, SIGNAL(moveFinished()), this, SLOT(slotGameMoveFinished()));
connect(m_game, SIGNAL(gameOver()), this, SLOT(slotGameOver()));
connect(m_game, SIGNAL(computerCantMove()), this, SLOT(slotComputerCantMove()));
connect(m_game, SIGNAL(playerCantMove()), this, SLOT(slotPlayerCantMove()));
if (m_game)
{
connect(m_game, SIGNAL(boardChanged()), this, SLOT(updateBoard()));
connect(m_game, SIGNAL(moveFinished()), this, SLOT(slotGameMoveFinished()));
connect(m_game, SIGNAL(gameOver()), this, SLOT(slotGameOver()));
connect(m_game, SIGNAL(computerCantMove()), this, SLOT(slotComputerCantMove()));
connect(m_game, SIGNAL(playerCantMove()), this, SLOT(slotPlayerCantMove()));
}
m_hint = KReversiPos();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment