1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-27 19:52:17 -05:00

Fix NPE related to changed initialization order in Android 4.2

This commit is contained in:
cketti 2012-11-22 22:50:13 +01:00
parent f0118ecb85
commit b96e7bb058

View File

@ -539,8 +539,10 @@ public class MessageViewFragment extends SherlockFragment implements OnClickList
} }
private void configureMenu(Menu menu) { private void configureMenu(Menu menu) {
// first run displayMessage() gets called before onCreateOptionMenu() // In Android versions prior to 4.2 onCreateOptionsMenu() (which calls us) is called before
if (menu == null) { // onActivityCreated() when mAccount isn't initialized yet. In that case we do nothing and
// wait for displayMessage() to call us again.
if (menu == null || mAccount == null) {
return; return;
} }