From 55c50ca8b6a09781b17b109273e88141c25aa1de Mon Sep 17 00:00:00 2001 From: Eric House Date: Sun, 23 Aug 2020 19:08:29 -0700 Subject: [PATCH] don't try to send via mqtt when to dest address --- xwords4/common/comms.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/xwords4/common/comms.c b/xwords4/common/comms.c index 631b71731..f72a1f992 100644 --- a/xwords4/common/comms.c +++ b/xwords4/common/comms.c @@ -1557,6 +1557,13 @@ sendMsg( CommsCtxt* comms, XWEnv xwe, MsgQueueElem* elem, const CommsConnType fi default: { XP_ASSERT( addr_hasType( &addr, typ ) ); + /* A more general check that the address type has the settings + it needs would be better here.... */ + if ( typ == COMMS_CONN_MQTT && 0 == addr.u.mqtt.devID ) { + XP_LOGFF( "not sending: MQTT address NULL" ); + break; + } + XP_ASSERT( !!comms->procs.send ); XP_U32 gameid = gameID( comms ); logAddr( comms, xwe, &addr, __func__ );