mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-04 20:46:28 +01:00
fix NPE: abort more quickly when unbundling a NLI that's not there
This commit is contained in:
parent
81a780d2ff
commit
0d4f96d3f6
1 changed files with 18 additions and 17 deletions
|
@ -95,28 +95,29 @@ public class NetLaunchInfo {
|
||||||
private NetLaunchInfo( Bundle bundle )
|
private NetLaunchInfo( Bundle bundle )
|
||||||
{
|
{
|
||||||
lang = bundle.getInt( MultiService.LANG );
|
lang = bundle.getInt( MultiService.LANG );
|
||||||
if ( 0 != lang ) { // don't bother if it's invalid
|
room = bundle.getString( MultiService.ROOM );
|
||||||
room = bundle.getString( MultiService.ROOM );
|
m_inviteID = bundle.getString( MultiService.INVITEID );
|
||||||
m_inviteID = bundle.getString( MultiService.INVITEID );
|
forceChannel = bundle.getInt( MultiService.FORCECHANNEL );
|
||||||
forceChannel = bundle.getInt( MultiService.FORCECHANNEL );
|
dict = bundle.getString( MultiService.DICT );
|
||||||
dict = bundle.getString( MultiService.DICT );
|
gameName = bundle.getString( MultiService.GAMENAME );
|
||||||
gameName = bundle.getString( MultiService.GAMENAME );
|
nPlayersT = bundle.getInt( MultiService.NPLAYERST );
|
||||||
nPlayersT = bundle.getInt( MultiService.NPLAYERST );
|
nPlayersH = bundle.getInt( MultiService.NPLAYERSH );
|
||||||
nPlayersH = bundle.getInt( MultiService.NPLAYERSH );
|
m_gameID = bundle.getInt( MultiService.GAMEID );
|
||||||
m_gameID = bundle.getInt( MultiService.GAMEID );
|
btName = bundle.getString( MultiService.BT_NAME );
|
||||||
btName = bundle.getString( MultiService.BT_NAME );
|
btAddress = bundle.getString( MultiService.BT_ADDRESS );
|
||||||
btAddress = bundle.getString( MultiService.BT_ADDRESS );
|
|
||||||
|
|
||||||
m_addrs = new CommsConnTypeSet( bundle.getInt( ADDRS_KEY ) );
|
m_addrs = new CommsConnTypeSet( bundle.getInt( ADDRS_KEY ) );
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static NetLaunchInfo makeFrom( Bundle bundle )
|
public static NetLaunchInfo makeFrom( Bundle bundle )
|
||||||
{
|
{
|
||||||
NetLaunchInfo nli = new NetLaunchInfo( bundle );
|
NetLaunchInfo nli = null;
|
||||||
nli.calcValid();
|
if ( 0 != bundle.getInt( MultiService.LANG ) ) { // quick test: valid?
|
||||||
if ( !nli.isValid() ) {
|
nli = new NetLaunchInfo( bundle );
|
||||||
nli = null;
|
nli.calcValid();
|
||||||
|
if ( !nli.isValid() ) {
|
||||||
|
nli = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return nli;
|
return nli;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue