Skip to content
Snippets Groups Projects
Commit f8141371 authored by lukebarnard's avatar lukebarnard
Browse files

Guard against no pushRules in getPushRuleById

so that clients that attempt to get push rules before they have
been fetched will receive `null` instead of an NPE.
parent 4ec90a4b
Branches
Tags
No related merge requests found
......@@ -357,6 +357,7 @@ function PushProcessor(client) {
* @return {object} The push rule, or null if no such rule was found
*/
this.getPushRuleById = function(ruleId) {
if (!client.pushRules) return null;
for (const scope of ['device', 'global']) {
if (client.pushRules[scope] === undefined) continue;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment