Skip to content

Commit

Permalink
Ensure accnt is not null before attemting to edit
Browse files Browse the repository at this point in the history
In some unknown scenario's it can be null and cause an NPE
  • Loading branch information
adrian committed Sep 16, 2012
1 parent 2014f1c commit 1578fe4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/com/u17od/upm/AccountsList.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,12 @@ private void editAccount(AccountInformation ai) {
if (Utilities.isSyncRequired(this)) {
UIUtilities.showToast(this, R.string.sync_required);
} else {
Intent i = new Intent(AccountsList.this, AddEditAccount.class);
i.putExtra(AddEditAccount.MODE, AddEditAccount.EDIT_MODE);
i.putExtra(AddEditAccount.ACCOUNT_TO_EDIT, ai.getAccountName());
startActivityForResult(i, AddEditAccount.EDIT_ACCOUNT_REQUEST_CODE);
if (ai != null) {
Intent i = new Intent(AccountsList.this, AddEditAccount.class);
i.putExtra(AddEditAccount.MODE, AddEditAccount.EDIT_MODE);
i.putExtra(AddEditAccount.ACCOUNT_TO_EDIT, ai.getAccountName());
startActivityForResult(i, AddEditAccount.EDIT_ACCOUNT_REQUEST_CODE);
}
}
}

Expand Down

0 comments on commit 1578fe4

Please sign in to comment.