diff --git a/src/components/views/room_settings/UrlPreviewSettings.js b/src/components/views/room_settings/UrlPreviewSettings.js index aad8d9d393..6fb04f3378 100644 --- a/src/components/views/room_settings/UrlPreviewSettings.js +++ b/src/components/views/room_settings/UrlPreviewSettings.js @@ -29,7 +29,10 @@ module.exports = React.createClass({ }, saveSettings: function() { - return [this.refs.urlPreviewsRoom.save(), this.refs.urlPreviewsSelf.save()]; + const promises = []; + if (this.refs.urlPreviewsRoom) promises.push(this.refs.urlPreviewsRoom.save()); + if (this.refs.urlPrviewsSelf) promises.push(this.refs.urlPreviewsSelf.save()); + return promises; }, render: function() { diff --git a/src/components/views/rooms/RoomSettings.js b/src/components/views/rooms/RoomSettings.js index f0f7a555c1..ad26f19af5 100644 --- a/src/components/views/rooms/RoomSettings.js +++ b/src/components/views/rooms/RoomSettings.js @@ -309,9 +309,9 @@ module.exports = React.createClass({ } // url preview settings - const ps = this.saveUrlPreviewSettings(); + let ps = this.saveUrlPreviewSettings(); if (ps.length > 0) { - promises.push(ps); + ps.map(p => promises.push(p)); } // related groups