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

Commit c629ee4d authored by Beverly's avatar Beverly
Browse files

Fix potential NPE

Test: manual
Bug: 112753848
Change-Id: I741a93348b1d69b419527f5dd6983227c28bc9ca
parent f9151368
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ import android.util.proto.ProtoOutputStream;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
@@ -722,10 +723,15 @@ public class NotificationManager {
    public List<NotificationChannelGroup> getNotificationChannelGroups() {
        INotificationManager service = getService();
        try {
            return service.getNotificationChannelGroups(mContext.getPackageName()).getList();
            final ParceledListSlice<NotificationChannelGroup> parceledList =
                    service.getNotificationChannelGroups(mContext.getPackageName());
            if (parceledList != null) {
                return parceledList.getList();
            }
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
        return new ArrayList<>();
    }

    /**