mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-24 02:12:15 -05:00
Don't crash when being started by an old unread widget intent
This commit is contained in:
parent
33a2b05701
commit
48c3fbd2ba
@ -427,6 +427,18 @@ public class MessageList extends K9FragmentActivity implements MessageListFragme
|
|||||||
mSearch.addAllowedFolder(mMessageReference.folderName);
|
mSearch.addAllowedFolder(mMessageReference.folderName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mSearch == null) {
|
||||||
|
// We've most likely been started by an old unread widget
|
||||||
|
String accountUuid = intent.getStringExtra("account");
|
||||||
|
String folderName = intent.getStringExtra("folder");
|
||||||
|
|
||||||
|
mSearch = new LocalSearch(folderName);
|
||||||
|
mSearch.addAccountUuid(accountUuid);
|
||||||
|
if (folderName != null) {
|
||||||
|
mSearch.addAllowedFolder(folderName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
String[] accountUuids = mSearch.getAccountUuids();
|
String[] accountUuids = mSearch.getAccountUuids();
|
||||||
mSingleAccountMode = (accountUuids.length == 1 && !mSearch.searchAllAccounts());
|
mSingleAccountMode = (accountUuids.length == 1 && !mSearch.searchAllAccounts());
|
||||||
mSingleFolderMode = mSingleAccountMode && (mSearch.getFolderNames().size() == 1);
|
mSingleFolderMode = mSingleAccountMode && (mSearch.getFolderNames().size() == 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user