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

Commit 0935f152 authored by Kang Li's avatar Kang Li
Browse files

Fixes NPE thrown in sort if new targets are added.

Test: manually tested it to verify that it works as expected.

Bug: 65035399
Change-Id: Ie99b05c5324f47cbac66687d7301ef62a7c83e55
parent d9abde75
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -337,6 +337,7 @@ class ResolverComparator implements Comparator<ResolvedComponentInfo> {
                final ResolverTarget rhsTarget = mTargetsDict.get(new ComponentName(
                        rhs.activityInfo.packageName, rhs.activityInfo.name));

                if (lhsTarget != null && rhsTarget != null) {
                    final int selectProbabilityDiff = Float.compare(
                        rhsTarget.getSelectProbability(), lhsTarget.getSelectProbability());

@@ -345,6 +346,7 @@ class ResolverComparator implements Comparator<ResolvedComponentInfo> {
                    }
                }
            }
        }

        CharSequence  sa = lhs.loadLabel(mPm);
        if (sa == null) sa = lhs.activityInfo.name;