Fix NPE on startup.

There is no invariant in the controller that the fragments it references
are non-null, so querying the fragment for state is not always valid.

Change-Id: I880053be4000260b03b54ed8741e646b01314e0d
This commit is contained in:
Ben Komalo 2011-05-05 11:19:30 -07:00
parent 075feb4556
commit ea56ccf6dd

View File

@ -487,7 +487,9 @@ class UIControllerTwoPane implements
* for the mailbox list. The two may be different.
*/
public long getMessageListMailboxId() {
return mMessageListFragment.getMailboxId();
return (mMessageListFragment == null)
? Mailbox.NO_MAILBOX
: mMessageListFragment.getMailboxId();
}
public long getMessageId() {