Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

do not error if createSiteData cannot build a siteKey #9431

Merged
merged 1 commit into from
Jun 13, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion js/state/syncUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,10 @@ module.exports.createSiteData = (site, appState) => {
const immutableSite = Immutable.fromJS(site)
const siteKey = siteUtil.getSiteKey(immutableSite) || siteUtil.getSiteKey(Immutable.fromJS(siteData))
if (siteKey === null) {
throw new Error('Sync could not create siteKey')
// May happen if this is called before the appStore object has its location
// field populated
console.log(`Ignoring entry because we can't create site key: ${JSON.stringify(site)}`)
return
}
if (module.exports.isSyncable('bookmark', immutableSite)) {
const objectId = site.objectId || module.exports.newObjectId(['sites', siteKey])
Expand Down