From 914fa857bed9b901aa76df0bd9b4a1b599d82ab3 Mon Sep 17 00:00:00 2001 From: Eric House Date: Tue, 14 Feb 2012 16:54:19 -0800 Subject: [PATCH] return COMMS_CONN_NONE as address type of null comms rather than asserting. --- xwords4/common/comms.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/xwords4/common/comms.c b/xwords4/common/comms.c index 91ca5572e..4c98d357c 100644 --- a/xwords4/common/comms.c +++ b/xwords4/common/comms.c @@ -858,8 +858,11 @@ comms_checkAddr( DeviceRole role, const CommsAddrRec* addr, XW_UtilCtxt* util ) CommsConnType comms_getConType( const CommsCtxt* comms ) { - XP_ASSERT( !!comms ); /* or: return COMMS_CONN_NONE */ - return comms->addr.conType; + CommsConnType typ = !!comms ? comms->addr.conType : COMMS_CONN_NONE; + if ( !comms ) { + XP_LOGF( "%s: returning COMMS_CONN_NONE for null comms", __func__ ); + } + return typ; } /* comms_getConType */ XP_Bool