You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-07 10:46:24 +03:00
Avoid potential NPE.
This commit is contained in:
@@ -335,7 +335,10 @@ function setWidget(event, roomId) {
|
|||||||
|
|
||||||
if (userWidget) {
|
if (userWidget) {
|
||||||
const client = MatrixClientPeg.get();
|
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
|
// Delete existing widget with ID
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user