Merge "Fix NPE in loadAttachmentCallback"

This commit is contained in:
Makoto Onuki 2011-01-05 16:03:56 -08:00 committed by Android (Google) Code Review
commit f72c4c2c2a

View File

@ -1415,6 +1415,11 @@ public abstract class MessageViewFragmentBase extends Fragment implements View.O
}
} else {
AttachmentInfo attachment = findAttachmentInfo(attachmentId);
if (attachment == null) {
// Called before LoadAttachmentsTask finishes.
// (Possible if you quickly close & re-open a message)
return;
}
attachment.cancelButton.setVisibility(View.GONE);
attachment.loadButton.setVisibility(View.VISIBLE);
attachment.progressView.setVisibility(View.INVISIBLE);