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

Commit cce3381e authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Guard against the NPE in setPreferenceIcon()" into tm-dev

parents 1cf78b8b 65d46ee1
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)) {