Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b4e2c150 authored by Sindhu Kanathur's avatar Sindhu Kanathur Committed by Gerrit - the friendly Code Review server
Browse files

Check the unsupported type's uri to avoid NullPointerException

Forwarding an unsupported type of mms may have an
unexpected Uri, such as missing authority part.
Make sure the uri has an authority before using it.

Change-Id: I33417d0566ad5ff93e2c52ddb6aa107641c7d5ba
CRs-Fixed: 583527
parent dca77760
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1182,7 +1182,8 @@ public class PduPersister {
            for (int i = 0; i < partsNum; i++) {
                PduPart part = body.getPart(i);
                Uri partUri = part.getDataUri();
                if ((partUri == null) || !partUri.getAuthority().startsWith("mms")) {
                if ((partUri == null) || TextUtils.isEmpty(partUri.getAuthority())
                        || !partUri.getAuthority().startsWith("mms")) {
                    toBeCreated.add(part);
                } else {
                    toBeUpdated.put(partUri, part);