mirror of
https://github.com/oxen-io/session-android.git
synced 2025-10-24 06:02:22 +00:00
fix crash on pending self-sent media
fixes #4016 Closes #4017 // FREEBIE
This commit is contained in:
committed by
Moxie Marlinspike
parent
df164a58c9
commit
923d9fb07b
@@ -88,6 +88,7 @@ public class AttachmentDownloadJob extends MasterSecretJob implements Injectable
|
||||
private void retrievePart(MasterSecret masterSecret, PduPart part, long messageId)
|
||||
throws IOException
|
||||
{
|
||||
|
||||
PartDatabase database = DatabaseFactory.getPartDatabase(context);
|
||||
File attachmentFile = null;
|
||||
|
||||
@@ -115,6 +116,8 @@ public class AttachmentDownloadJob extends MasterSecretJob implements Injectable
|
||||
private TextSecureAttachmentPointer createAttachmentPointer(MasterSecret masterSecret, PduPart part)
|
||||
throws InvalidPartException
|
||||
{
|
||||
if (part.getContentLocation() == null) throw new InvalidPartException("null content location");
|
||||
|
||||
try {
|
||||
AsymmetricMasterSecret asymmetricMasterSecret = MasterSecretUtil.getAsymmetricMasterSecret(context, masterSecret);
|
||||
long id = Long.parseLong(Util.toIsoString(part.getContentLocation()));
|
||||
@@ -153,6 +156,7 @@ public class AttachmentDownloadJob extends MasterSecretJob implements Injectable
|
||||
}
|
||||
|
||||
private static class InvalidPartException extends Exception {
|
||||
public InvalidPartException(String s) {super(s);}
|
||||
public InvalidPartException(Exception e) {super(e);}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user