mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-20 22:26:54 +01:00
fix NPE when installed with existing SMS invites in inbox
This commit is contained in:
parent
51a561077c
commit
b1ae563ae6
2 changed files with 9 additions and 11 deletions
|
@ -2184,4 +2184,6 @@
|
|||
|
||||
<string name="no_hide_titlebar">This setting is ignored on devices
|
||||
like yours that depend on the \"Action bar\".</string>
|
||||
|
||||
<string name="sms_ready_text">Tap the receiving device now</string>
|
||||
</resources>
|
||||
|
|
|
@ -411,7 +411,7 @@ public class GameUtils {
|
|||
{
|
||||
long rowid = -1;
|
||||
|
||||
Assert.assertNotNull( inviteID );
|
||||
Assert.assertNotNull( inviteID ); // firing
|
||||
CurGameInfo gi = new CurGameInfo( context, inviteID );
|
||||
gi.setLang( lang[0], dict[0] );
|
||||
lang[0] = gi.dictLang;
|
||||
|
@ -513,8 +513,10 @@ public class GameUtils {
|
|||
if ( isHost ) {
|
||||
addr = new CommsAddrRec(CommsAddrRec.CommsConnType.COMMS_CONN_SMS);
|
||||
}
|
||||
String inviteID = GameUtils.formatGameID( gameID );
|
||||
return makeNewMultiGame( context, groupID, addr, langa, dicta,
|
||||
nPlayersT, nPlayersH, null, gameID, isHost );
|
||||
nPlayersT, nPlayersH, inviteID, gameID,
|
||||
isHost );
|
||||
}
|
||||
|
||||
public static void launchInviteActivity( Activity activity, int chosen,
|
||||
|
@ -524,20 +526,14 @@ public class GameUtils {
|
|||
{
|
||||
Assert.assertNotNull( inviteID );
|
||||
|
||||
String msgString;
|
||||
if ( DlgDelegate.NFC_BTN == chosen ) {
|
||||
msgString = NetLaunchInfo.makeLaunchJSON( activity, room, inviteID,
|
||||
lang, dict, nPlayers );
|
||||
Utils.showToast( activity, R.string.sms_ready_text );
|
||||
} else {
|
||||
Uri gameUri = NetLaunchInfo.makeLaunchUri( activity, room, inviteID,
|
||||
lang, dict, nPlayers );
|
||||
msgString = null == gameUri ? null : gameUri.toString();
|
||||
}
|
||||
String msgString = null == gameUri ? null : gameUri.toString();
|
||||
|
||||
if ( null != msgString ) {
|
||||
if ( DlgDelegate.NFC_BTN == chosen ) {
|
||||
Utils.showToast( activity, "Tap the receiving device now" );
|
||||
} else {
|
||||
if ( null != msgString ) {
|
||||
boolean choseEmail = DlgDelegate.EMAIL_BTN == chosen;
|
||||
|
||||
int fmtId = choseEmail? R.string.invite_htmf : R.string.invite_txtf;
|
||||
|
|
Loading…
Reference in a new issue