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

Commit aa2e3e78 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

am: 6871a7c2

Change-Id: Idec3747f6db2c00a3a09bfc99247933aa8fc0e4a
parents de0b5923 6871a7c2
Loading
Loading
Loading
Loading
+3 −7
Original line number Diff line number Diff line
@@ -1513,14 +1513,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;
            }
        }