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

Commit 6871a7c2 authored by Arc Wang's avatar Arc Wang Committed by android-build-merger
Browse files

Merge "Simplify SmsMessage null check in writeInboxMessage." am: 8e8156c6

am: e65c66b0

Change-Id: I70112f5dcc64deb11c89b5d007a0ef1d7ded19de
parents 5a248321 e65c66b0
Loading
Loading
Loading
Loading
+3 −7
Original line number Diff line number Diff line
@@ -1516,14 +1516,10 @@ public abstract class InboundSmsHandler extends StateMachine {
            loge("Failed to parse SMS pdu");
            return null;
        }
        // Sometimes, SmsMessage.mWrappedSmsMessage is null causing NPE when we access
        // the methods on it although the SmsMessage itself is not null. So do this check
        // before we do anything on the parsed SmsMessages.
        // Sometimes, SmsMessage is null if it can’t be parsed correctly.
        for (final SmsMessage sms : messages) {
            try {
                sms.getDisplayMessageBody();
            } catch (NullPointerException e) {
                loge("NPE inside SmsMessage");
            if (sms == null) {
                loge("Can’t write null SmsMessage");
                return null;
            }
        }