Fix NPE when the attachment for a link preview is null.

This commit is contained in:
Alex Hart 2022-08-31 10:13:20 -03:00 committed by Greyson Parrelli
parent cb0208af4d
commit 3edc97eb38

View file

@ -131,7 +131,7 @@ object Stories {
ApplicationDependencies.getJobManager().add(job)
}
if (record.hasLinkPreview()) {
if (record.hasLinkPreview() && record.linkPreviews[0].attachmentId != null) {
ApplicationDependencies.getJobManager().add(
AttachmentDownloadJob(record.id, record.linkPreviews[0].attachmentId, true)
)