[Media Device] Add null check to avoid npe for compareTo method
Bug: 217583408 Test: N/A Change-Id: Id3873bc79eb8200379cf63b7945fb37c4d963517
This commit is contained in:
committed by
Shaowei Shen
parent
b80800cc9e
commit
4631d24e79
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user