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

Commit cedc753e authored by Łukasz Rymanowski's avatar Łukasz Rymanowski
Browse files

gtbs: Fix crash on remove call

java.lang.NullPointerException
	at java.util.TreeMap.getEntry(TreeMap.java:346)
	at java.util.TreeMap.remove(TreeMap.java:602)
	at com.android.bluetooth.tbs.TbsGeneric.callRemoved(TbsGeneric.java:447)
	at com.android.bluetooth.tbs.TbsService.callRemoved(TbsService.java:314)

Bug: 215045176
Test: compile
Change-Id: I3cd17fe9cf274ca050eed1c0f530f9f1d8365be8
parent a84bfeaf
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -444,6 +444,11 @@ public class TbsGeneric {
        }

        Integer callIndex = bearer.callIdIndexMap.remove(callId);
        if (callIndex == null) {
            Log.e(TAG, "callIndex: is null for callId" + callId);
            return;
        }

        TbsCall tbsCall = mCurrentCallsList.remove(callIndex);
        if (tbsCall == null) {
            Log.e(TAG, "callRemoved: no such call");