1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-28 05:03:59 +03:00

Appease the tests

This commit is contained in:
Travis Ralston
2019-07-31 11:00:44 -06:00
parent 101217cfb6
commit c7be810e65

View File

@@ -468,7 +468,13 @@ PushProcessor.actionListToActionsObject = function(actionlist) {
* @returns {object} The rewritten rules
*/
PushProcessor.rewriteDefaultRules = function(incomingRules) {
const newRules = JSON.parse(JSON.stringify(incomingRules)); // deep clone
let newRules = JSON.parse(JSON.stringify(incomingRules)); // deep clone
// These lines are mostly to make the tests happy. We shouldn't run into these
// properties missing in practice.
if (!newRules) newRules = {};
if (!newRules.global) newRules.global = {};
if (!newRules.global.override) newRules.global.override = [];
// Fix default override rules
newRules.global.override = newRules.global.override.map(r => {