Address reports of crashes tapping wordlist button when device is

having trouble making initial relay connection for a game (which I
can't reproduce) by disabling that button when there isn't a current
player.
This commit is contained in:
Eric House 2012-01-17 18:58:45 -08:00
parent 00575c6d4e
commit 8a66cd4c1f
3 changed files with 8 additions and 3 deletions

View file

@ -1580,6 +1580,8 @@ public class BoardActivity extends XWActivity
m_toolbar.update( Toolbar.BUTTON_HINT_PREV, m_gsi.canHint );
m_toolbar.update( Toolbar.BUTTON_HINT_NEXT, m_gsi.canHint );
m_toolbar.update( Toolbar.BUTTON_CHAT, m_gsi.gameIsConnected );
m_toolbar.update( Toolbar.BUTTON_BROWSE_DICT,
null != m_gi.dictName( m_view.getCurPlayer() ) );
}
private void adjustTradeVisibility()

View file

@ -71,7 +71,7 @@ public class BoardView extends View implements DrawCtx, BoardHandler,
private int m_layoutWidth;
private int m_layoutHeight;
private Canvas m_canvas; // owns the bitmap
private int m_trayOwner;
private int m_trayOwner = -1;
private Rect m_valRect;
private Rect m_letterRect;
private Drawable m_rightArrow;

View file

@ -305,8 +305,11 @@ public class CurGameInfo {
public String dictName( int indx )
{
LocalPlayer lp = players[indx];
return dictName( lp );
String dname = null;
if ( 0 <= indx && indx < nPlayers ) {
dname = dictName( players[indx] );
}
return dname;
}
public boolean addPlayer()