Avoid potential NPE.
This commit is contained in:
parent
86461bc88f
commit
ee4310cc41
1 changed files with 4 additions and 1 deletions
|
@ -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 {
|
||||||
|
|
Loading…
Reference in a new issue