Fixed NPE (that should never occur, but there is an input validation bug)

This commit is contained in:
str4d
2014-05-20 11:58:02 +00:00
parent 36691ed957
commit 33832bb887

View File

@@ -84,10 +84,13 @@ public class ViewEmailFragment extends Fragment {
sender.setText(BoteHelper.getDisplayAddress(fromAddress));
for (Address recipient : email.getToAddresses()) {
TextView tv = new TextView(getActivity());
tv.setText(BoteHelper.getDisplayAddress(recipient.toString()));
recipients.addView(tv);
Address[] emailRecipients = email.getToAddresses();
if (emailRecipients != null) {
for (Address recipient : emailRecipients) {
TextView tv = new TextView(getActivity());
tv.setText(BoteHelper.getDisplayAddress(recipient.toString()));
recipients.addView(tv);
}
}
if (email.getSentDate() != null)