Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4288789e authored by Yaroslav Halchenko's avatar Yaroslav Halchenko
Browse files

BF: mAccount must not be accessed before verfied to be non-null

otherwise obviously leads to crashes.
IMHO this was a logical location to move, and it resolved my issue when
account was not yet accessible due to not yet accepted key upon importing
old settings from a stored file
parent e23ba4c0
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -820,15 +820,14 @@ public class MessageList
        mStars = K9.messageListStars();
        mCheckboxes = K9.messageListCheckboxes();

        mSortType = mAccount.getSortType();
        mSortAscending = mAccount.isSortAscending(mSortType);
        mSortDateAscending = mAccount.isSortAscending(SortType.SORT_DATE);

        mController.addListener(mAdapter.mListener);

        Account[] accountsWithNotification;
        if (mAccount != null) {
            accountsWithNotification = new Account[] { mAccount };
            mSortType = mAccount.getSortType();
            mSortAscending = mAccount.isSortAscending(mSortType);
            mSortDateAscending = mAccount.isSortAscending(SortType.SORT_DATE);
        } else {
            Preferences preferences = Preferences.getPreferences(this);
            accountsWithNotification = preferences.getAccounts();