Clone reads of account data to prevent mutation

pull/21833/head
Travis Ralston 2020-06-22 11:24:04 -06:00
parent fe65b7631d
commit 9e3c101172
1 changed files with 1 additions and 1 deletions

View File

@ -162,7 +162,7 @@ export default class AccountSettingsHandler extends MatrixClientBackedSettingsHa
const event = cli.getAccountData(eventType);
if (!event || !event.getContent()) return null;
return event.getContent();
return JSON.parse(JSON.stringify(event.getContent())); // clone to prevent mutation
}
_notifyBreadcrumbsUpdate(event) {