fixed crash performing search when account key not present

This commit is contained in:
Mariotaku Lee 2016-03-20 15:17:41 +08:00
parent b228d3671b
commit a7d96b3de3
1 changed files with 4 additions and 1 deletions

View File

@ -224,7 +224,10 @@ public class QuickSearchBarActivity extends BaseActivity implements OnClickListe
if (savedInstanceState == null) {
final Intent intent = getIntent();
final UserKey accountKey = intent.getParcelableExtra(EXTRA_ACCOUNT_KEY);
final int index = accountsSpinnerAdapter.findPositionByKey(accountKey);
int index = -1;
if (accountKey != null) {
index = accountsSpinnerAdapter.findPositionByKey(accountKey);
}
if (index != -1) {
mAccountSpinner.setSelection(index);
}