mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-30 10:26:58 +01:00
don't crash when public rooms list is empty
This commit is contained in:
parent
953e4601b9
commit
6b1dabd8e2
1 changed files with 4 additions and 2 deletions
|
@ -781,8 +781,10 @@ public class GameConfig extends Activity implements View.OnClickListener,
|
|||
ArrayAdapter<String> adapter =
|
||||
(ArrayAdapter<String>)m_roomChoose.getAdapter();
|
||||
if ( null != adapter ) {
|
||||
m_car.ip_relay_invite =
|
||||
adapter.getItem(m_roomChoose.getSelectedItemPosition());
|
||||
int pos = m_roomChoose.getSelectedItemPosition();
|
||||
if ( pos >= 0 && pos < adapter.getCount() ) {
|
||||
m_car.ip_relay_invite = adapter.getItem(pos);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
m_car.ip_relay_invite = Utils.getText( this, R.id.room_edit );
|
||||
|
|
Loading…
Reference in a new issue