Fix crash in logging when one player fails to reveal their move

This commit is contained in:
Eric Frias 2016-11-16 15:57:11 -05:00
parent 0a6e25507e
commit 935dac7ae6

View file

@ -470,7 +470,8 @@ namespace graphene { namespace chain {
{
// we now know who played what, figure out if we have a winner
const rock_paper_scissors_game_details& rps_game_details = game_details.get<rock_paper_scissors_game_details>();
if (rps_game_details.reveal_moves[0]->gesture == rps_game_details.reveal_moves[1]->gesture)
if (rps_game_details.reveal_moves[0] && rps_game_details.reveal_moves[1] &&
rps_game_details.reveal_moves[0]->gesture == rps_game_details.reveal_moves[1]->gesture)
ilog("The game was a tie, both players threw ${gesture}", ("gesture", rps_game_details.reveal_moves[0]->gesture));
else
{