mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-16 21:24:59 +08:00
Clone reads of account data to prevent mutation
This commit is contained in:
parent
fe65b7631d
commit
9e3c101172
@ -162,7 +162,7 @@ export default class AccountSettingsHandler extends MatrixClientBackedSettingsHa
|
|||||||
|
|
||||||
const event = cli.getAccountData(eventType);
|
const event = cli.getAccountData(eventType);
|
||||||
if (!event || !event.getContent()) return null;
|
if (!event || !event.getContent()) return null;
|
||||||
return event.getContent();
|
return JSON.parse(JSON.stringify(event.getContent())); // clone to prevent mutation
|
||||||
}
|
}
|
||||||
|
|
||||||
_notifyBreadcrumbsUpdate(event) {
|
_notifyBreadcrumbsUpdate(event) {
|
||||||
|
Loading…
Reference in New Issue
Block a user