Merge pull request #3629 from matrix-org/travis/breadcrumbs-fix

Add a bit more safety around breadcrumbs
This commit is contained in:
Travis Ralston 2019-11-18 14:35:46 -07:00 committed by GitHub
commit fea8737632
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -126,6 +126,7 @@ export default class AccountSettingsHandler extends MatrixClientBackedSettingsHa
if (!content || !content['recent_rooms']) {
content = this._getSettings(BREADCRUMBS_LEGACY_EVENT_TYPE);
}
if (!content) content = {}; // If we still don't have content, make some
content['recent_rooms'] = newValue;
return MatrixClientPeg.get().setAccountData(BREADCRUMBS_EVENT_TYPE, content);