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

Commit 65d46ee1 authored by Jason Chiu's avatar Jason Chiu
Browse files

Guard against the NPE in setPreferenceIcon()

Fix: 232902867
Test: robotest
Change-Id: I01f2a6aa8dab9c8e099588e440fc35ed1093592a
parent c4899bf0
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -422,6 +422,11 @@ public class DashboardFeatureProviderImpl implements DashboardFeatureProvider {
    private void setPreferenceIcon(Preference preference, Tile tile, boolean forceRoundedIcon,
            String iconPackage, Icon icon) {
        Drawable iconDrawable = icon.loadDrawable(preference.getContext());
        if (iconDrawable == null) {
            Log.w(TAG, "Set null preference icon for: " + iconPackage);
            preference.setIcon(null);
            return;
        }
        if (TextUtils.equals(tile.getCategory(), CategoryKey.CATEGORY_HOMEPAGE)) {
            iconDrawable.setTint(Utils.getHomepageIconColor(preference.getContext()));
        } else if (forceRoundedIcon && !TextUtils.equals(mContext.getPackageName(), iconPackage)) {