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

Commit c8dbba03 authored by Nitin Srivastava's avatar Nitin Srivastava Committed by Matthew Xie
Browse files

BT: HDP: Add NULL check in cleanupApps

Add NULL check for profile Apps data before accessing
them during cleanup.

Change-Id: Iebc6dc0399ed3d77078962b50550d3080a82644f
parent 3cac00d4
Loading
Loading
Loading
Loading
+10 −9
Original line number Original line Diff line number Diff line
@@ -110,10 +110,10 @@ public class HealthService extends ProfileService {
    }
    }


    private void cleanupApps(){
    private void cleanupApps(){
        if (mApps != null) {
            Iterator <Map.Entry<BluetoothHealthAppConfiguration,AppInfo>>it
            Iterator <Map.Entry<BluetoothHealthAppConfiguration,AppInfo>>it
                        = mApps.entrySet().iterator();
                        = mApps.entrySet().iterator();
        while (it.hasNext())
            while (it.hasNext()) {
        {
               Map.Entry<BluetoothHealthAppConfiguration,AppInfo> entry   = it.next();
               Map.Entry<BluetoothHealthAppConfiguration,AppInfo> entry   = it.next();
               AppInfo appInfo = entry.getValue();
               AppInfo appInfo = entry.getValue();
               if (appInfo != null)
               if (appInfo != null)
@@ -121,6 +121,7 @@ public class HealthService extends ProfileService {
               it.remove();
               it.remove();
            }
            }
        }
        }
    }
    protected boolean cleanup() {
    protected boolean cleanup() {
        mHandler = null;
        mHandler = null;
        //Cleanup native
        //Cleanup native