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

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

Merge "Simplify SmsMessage null check in writeInboxMessage."

am: 8e8156c6

Change-Id: Ia4b75ee487e2ee4b7b6d2019ff57d08576fca90b
parents bf1a0bb2 8e8156c6
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;
            }
        }