You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-08 21:42:24 +03:00
Avoid potential NPE.
This commit is contained in:
@@ -335,7 +335,10 @@ function setWidget(event, roomId) {
|
||||
|
||||
if (userWidget) {
|
||||
const client = MatrixClientPeg.get();
|
||||
const userWidgets = client.getAccountData('m.widgets').getContent() || {};
|
||||
let userWidgets = {};
|
||||
if (client.getAccountData('m.widgets')) {
|
||||
userWidgets = client.getAccountData('m.widgets').getContent();
|
||||
}
|
||||
|
||||
// Delete existing widget with ID
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user