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

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

Fix NPE when deleting old zen rules am: 7bb9cd92 am: 8a021141

parents 8e552b10 8a021141
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -404,7 +404,14 @@ public class ZenModeHelper {
            newConfig = mConfig.copy();
            for (int i = newConfig.automaticRules.size() - 1; i >= 0; i--) {
                ZenRule rule = newConfig.automaticRules.get(newConfig.automaticRules.keyAt(i));
                if (rule.pkg.equals(packageName) && canManageAutomaticZenRule(rule)) {
                String pkg = rule.pkg != null
                        ? rule.pkg
                        : (rule.component != null)
                                ? rule.component.getPackageName()
                                : (rule.configurationActivity != null)
                                        ? rule.configurationActivity.getPackageName()
                                        : null;
                if (Objects.equals(pkg, packageName) && canManageAutomaticZenRule(rule)) {
                    newConfig.automaticRules.removeAt(i);
                }
            }