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

Commit 8edcdd37 authored by Kihong Seong's avatar Kihong Seong
Browse files

Add null check to avoid NPE when text message has null datetime

Bug: 262746041
Test: atest BluetoothInstrumentationTests
Change-Id: I499ce08952c0b03d6d64832bd9bfbc55a201ba43
parent 89caf445
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -797,6 +797,11 @@ class MceStateMachine extends StateMachine {
                                + " [Connected]: fetch message content, handle=" + msg.getHandle());
                    }
                    // A message listing coming from the server should always have up to date data
                    if (msg.getDateTime() == null) {
                        Log.w(TAG, "message with handle " + msg.getHandle()
                                + " has a null datetime, ignoring");
                        continue;
                    }
                    mMessages.put(msg.getHandle(), new MessageMetadata(msg.getHandle(),
                            msg.getDateTime().getTime(), msg.isRead(), MESSAGE_SEEN));
                    getMessage(msg.getHandle());