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

Commit 4631d24e authored by shaoweishen's avatar shaoweishen Committed by Shaowei Shen
Browse files

[Media Device] Add null check to avoid npe for compareTo method

Bug: 217583408
Test: N/A
Change-Id: Id3873bc79eb8200379cf63b7945fb37c4d963517
parent b80800cc
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -323,6 +323,9 @@ public abstract class MediaDevice implements Comparable<MediaDevice> {
     */
    @Override
    public int compareTo(MediaDevice another) {
        if (another == null) {
            return -1;
        }
        // Check Bluetooth device is have same connection state
        if (isConnected() ^ another.isConnected()) {
            if (isConnected()) {