Avoid potential NPE.

pull/21833/head
Richard Lewis 2018-02-25 21:47:23 +00:00
parent 86461bc88f
commit ee4310cc41
1 changed files with 4 additions and 1 deletions

View File

@ -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 {