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

Commit 68e09db2 authored by Julia Reynolds's avatar Julia Reynolds Committed by Automerger Merge Worker
Browse files

Guard against NPE am: 663cc934

Change-Id: I56317984b7803128829f77889dccd4d69601bad9
parents 7e172050 663cc934
Loading
Loading
Loading
Loading
+14 −9
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ import android.text.TextUtils;
import android.util.ArrayMap;
import android.util.ArraySet;
import android.util.IconDrawableFactory;
import android.util.Slog;

import com.android.settings.R;
import com.android.settings.Utils;
@@ -294,6 +295,7 @@ public class RecentNotifyingAppsPreferenceController extends AbstractPreferenceC
        List<NotifyingApp> displayableApps = new ArrayList<>(SHOW_RECENT_APP_COUNT);
        int count = 0;
        for (NotifyingApp app : mApps) {
            try {
                final ApplicationsState.AppEntry appEntry = mApplicationsState.getEntry(
                        app.getPackage(), app.getUserId());
                if (appEntry == null) {
@@ -304,6 +306,9 @@ public class RecentNotifyingAppsPreferenceController extends AbstractPreferenceC
                if (count >= SHOW_RECENT_APP_COUNT) {
                    break;
                }
            } catch (Exception e) {
                Slog.e(TAG, "Failed to find app " + app.getPackage() + "/" + app.getUserId(), e);
            }
        }
        return displayableApps;
    }