From fd36590e7f1f7aa4aec8173f6f724643285be170 Mon Sep 17 00:00:00 2001 From: Eric House <eehouse@eehouse.org> Date: Tue, 21 Feb 2023 17:31:20 -0800 Subject: [PATCH] fix assertions that assumed multi-device --- xwords4/common/server.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/xwords4/common/server.c b/xwords4/common/server.c index 316c4c897..2bf906c4e 100644 --- a/xwords4/common/server.c +++ b/xwords4/common/server.c @@ -3997,6 +3997,7 @@ server_getRematchInfo( const ServerCtxt* server, XW_UtilCtxt* newUtil, XP_U32 gameID, RematchAddrs* ra ) { LOG_FUNC(); + const CommsCtxt* comms = server->vol.comms; XP_Bool success = server_canRematch( server ); if ( success ) { XP_MEMSET( ra, 0, sizeof(*ra) ); @@ -4012,8 +4013,9 @@ server_getRematchInfo( const ServerCtxt* server, XW_UtilCtxt* newUtil, LOGGI( newUtil->gameInfo, "ready to invite" ); /* Now build the address list */ - const CommsCtxt* comms = server->vol.comms; - if ( amServer( server ) ) { + if ( !comms ) { + /* no addressing to do!! */ + } else if ( amServer( server ) ) { /* skip 0; it's me */ for ( int ii = 1; ii < server->nv.nDevices; ++ii ) { XP_PlayerAddr channelNo = server->nv.addresses[ii].channelNo; @@ -4047,7 +4049,7 @@ server_getRematchInfo( const ServerCtxt* server, XW_UtilCtxt* newUtil, } #endif - XP_ASSERT( !success || server->vol.gi->nPlayers == ra->nAddrs + 1 ); + XP_ASSERT( !success || !comms || server->vol.gi->nPlayers == ra->nAddrs + 1 ); LOG_RETURNF( "%s", boolToStr(success) ); return success; }