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

Commit 0851c8d5 authored by qing's avatar qing Committed by Soma Jagannathan
Browse files

Prevent null pointer exception in getCurrentCall method

HeadsetClientService#getCurrentCalls() return nullable, so needs to prevent null pointer in its consumer methods.

Bug: 263323082

Test: N/A
Change-Id: I163dc68cb3609900bc5c6907c1643447b0a9bba9
(cherry picked from commit a0df2605)
Merged-In: I163dc68cb3609900bc5c6907c1643447b0a9bba9
parent b24a304a
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -612,10 +612,12 @@ public class HeadsetClientService extends ProfileService {
                List<BluetoothHeadsetClientCall> defaultValue = new ArrayList<>();
                if (service != null) {
                    List<HfpClientCall> calls = service.getCurrentCalls(device);
                    if (calls != null) {
                        for (HfpClientCall call : calls) {
                            defaultValue.add(toLegacyCall(call));
                        }
                    }
                }
                receiver.send(defaultValue);
            } catch (RuntimeException e) {
                receiver.propagateException(e);