Avoid potential NPE.

This commit is contained in:
Richard Lewis 2018-02-25 21:47:23 +00:00
parent 86461bc88f
commit ee4310cc41

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 {