don't crash on malformed invite URL

This commit is contained in:
Eric House 2012-11-26 03:08:54 -08:00
parent 63b29a2cb2
commit 6f3881d53d

View file

@ -66,36 +66,41 @@ public class DispatchNotify extends Activity {
}
} else if ( null != data ) { // relay invite redirected URL case
NetLaunchInfo nli = new NetLaunchInfo( data );
long rowid = DBUtils.getRowIDForOpen( this, nli );
if ( DBUtils.ROWID_NOTFOUND == rowid ) {
boolean haveDict;
if ( null == nli.dict ) { // can only test for language support
haveDict =
0 < DictLangCache.getHaveLang( this, nli.lang ).length;
} else {
haveDict = DictLangCache.haveDict( this, nli.lang, nli.dict );
}
if ( haveDict ) {
if ( !tryHandle( data ) ) {
mustLaunch = true;
if ( null != nli && nli.isValid() ) {
long rowid = DBUtils.getRowIDForOpen( this, nli );
if ( DBUtils.ROWID_NOTFOUND == rowid ) {
boolean haveDict;
if ( null == nli.dict ) { // can only test for language support
haveDict =
0 < DictLangCache.getHaveLang( this,
nli.lang ).length;
} else {
haveDict =
DictLangCache.haveDict( this, nli.lang, nli.dict );
}
if ( haveDict ) {
if ( !tryHandle( data ) ) {
mustLaunch = true;
}
} else {
Intent intent =
MultiService.makeMissingDictIntent( this, nli );
intent.putExtra( MultiService.OWNER,
MultiService.OWNER_RELAY );
// do we have gameID?
MultiService.
postMissingDictNotification( this, intent,
nli.inviteID
.hashCode() );
}
} else {
Intent intent = MultiService.makeMissingDictIntent( this,
nli );
intent.putExtra( MultiService.OWNER,
MultiService.OWNER_RELAY );
// do we have gameID?
MultiService.
postMissingDictNotification( this, intent,
nli.inviteID.hashCode() );
}
} else {
DbgUtils.logf( "DispatchNotify: dropping duplicate invite" );
GameSummary summary = DBUtils.getSummary( this, rowid );
if ( null != summary ) {
gameID = summary.gameID;
if ( !tryHandle( gameID ) ) {
mustLaunch = true;
DbgUtils.logf( "DispatchNotify: dropping duplicate invite" );
GameSummary summary = DBUtils.getSummary( this, rowid );
if ( null != summary ) {
gameID = summary.gameID;
if ( !tryHandle( gameID ) ) {
mustLaunch = true;
}
}
}
}