use game dict if no player dict (to avoid NPE)

This commit is contained in:
Andy2 2011-04-25 21:01:15 -07:00
parent ecc5357ef8
commit 7a5920e9f2
2 changed files with 11 additions and 1 deletions

View file

@ -676,7 +676,8 @@ public class GameConfig extends XWActivity
ArrayAdapter<String> adapter =
DictLangCache.getDictsAdapter( this, m_gi.dictLang );
configSpinnerWDownload( dictsSpinner, adapter, onSel, lp.dictName );
configSpinnerWDownload( dictsSpinner, adapter, onSel,
m_gi.dictName(lp) );
}
private void configLangSpinner()

View file

@ -279,6 +279,15 @@ public class CurGameInfo {
return DictLangCache.getLangName( m_context, dictLang );
}
public String dictName( final LocalPlayer lp )
{
String dname = lp.dictName;
if ( null == dname ) {
dname = dictName;
}
return dname;
}
public boolean addPlayer()
{
boolean added = nPlayers < MAX_NUM_PLAYERS;