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

Commit

Permalink
Merge pull request #9431 from brave/fix/9430
Browse files Browse the repository at this point in the history
do not error if createSiteData cannot build a siteKey
  • Loading branch information
diracdeltas authored Jun 13, 2017
2 parents 849f5fd + d37ce0c commit c5718d0
Showing 1 changed file with 4 additions and 1 deletion.
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

0 comments on commit c5718d0

Please sign in to comment.