mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-18 22:26:30 +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> adapter =
|
||||||
(ArrayAdapter<String>)m_roomChoose.getAdapter();
|
(ArrayAdapter<String>)m_roomChoose.getAdapter();
|
||||||
if ( null != adapter ) {
|
if ( null != adapter ) {
|
||||||
m_car.ip_relay_invite =
|
int pos = m_roomChoose.getSelectedItemPosition();
|
||||||
adapter.getItem(m_roomChoose.getSelectedItemPosition());
|
if ( pos >= 0 && pos < adapter.getCount() ) {
|
||||||
|
m_car.ip_relay_invite = adapter.getItem(pos);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
m_car.ip_relay_invite = Utils.getText( this, R.id.room_edit );
|
m_car.ip_relay_invite = Utils.getText( this, R.id.room_edit );
|
||||||
|
|
Loading…
Reference in a new issue