diff --git a/src/components/views/rooms/Stickerpack.js b/src/components/views/rooms/Stickerpack.js index a61ca84fbd..3722818bf6 100644 --- a/src/components/views/rooms/Stickerpack.js +++ b/src/components/views/rooms/Stickerpack.js @@ -87,7 +87,6 @@ export default class Stickerpack extends React.Component { this._getStickerPickerWidget(); return; } - console.error("Unhandled widget action"); } _getStickerPickerWidget() { diff --git a/src/utils/widgets.js b/src/utils/widgets.js index 081815fed9..2c7901a18f 100644 --- a/src/utils/widgets.js +++ b/src/utils/widgets.js @@ -36,8 +36,12 @@ function getUserWidgets() { if (!client) { throw new Error('User not logged in'); } - const userWidgets = client.getAccountData('m.widgets').getContent() || {}; - return Object.keys(userWidgets).map((key) => userWidgets[key]); + const userWidgets = client.getAccountData('m.widgets'); + let userWidgetContent = {}; + if (userWidgets && userWidgets.getContent()) { + userWidgetContent = userWidgets.getContent(); + } + return Object.keys(userWidgetContent).map((key) => userWidgetContent[key]); } /**