mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-22 16:07:30 +00:00
Fix for NPE on empty MMS PDU
This commit is contained in:
parent
62cad05acb
commit
b805c4db4e
@ -71,13 +71,13 @@ public class MmsDownloader extends MmscProcessor {
|
|||||||
getApnInformation());
|
getApnInformation());
|
||||||
RetrieveConf retrieved = (RetrieveConf)new PduParser(pdu).parse();
|
RetrieveConf retrieved = (RetrieveConf)new PduParser(pdu).parse();
|
||||||
|
|
||||||
for (int i=0;i<retrieved.getBody().getPartsNum();i++) {
|
|
||||||
Log.w("MmsDownloader", "Sent MMS part of content-type: " + new String(retrieved.getBody().getPart(i).getContentType()));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (retrieved == null)
|
if (retrieved == null)
|
||||||
throw new IOException("Bad retrieved PDU");
|
throw new IOException("Bad retrieved PDU");
|
||||||
|
|
||||||
|
for (int i=0;i<retrieved.getBody().getPartsNum();i++) {
|
||||||
|
Log.w("MmsDownloader", "Sent MMS part of content-type: " +
|
||||||
|
new String(retrieved.getBody().getPart(i).getContentType()));
|
||||||
|
}
|
||||||
|
|
||||||
if (retrieved.getSubject() != null && WirePrefix.isEncryptedMmsSubject(retrieved.getSubject().getString())) {
|
if (retrieved.getSubject() != null && WirePrefix.isEncryptedMmsSubject(retrieved.getSubject().getString())) {
|
||||||
long messageId = mmsDatabase.insertSecureMessageReceived(retrieved, item.getContentLocation(), item.getThreadId());
|
long messageId = mmsDatabase.insertSecureMessageReceived(retrieved, item.getContentLocation(), item.getThreadId());
|
||||||
@ -177,6 +177,4 @@ public class MmsDownloader extends MmscProcessor {
|
|||||||
protected String getConnectivityAction() {
|
protected String getConnectivityAction() {
|
||||||
return SendReceiveService.DOWNLOAD_MMS_CONNECTIVITY_ACTION;
|
return SendReceiveService.DOWNLOAD_MMS_CONNECTIVITY_ACTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user