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

Commit

Permalink
do not error if createSiteData cannot build a siteKey
Browse files Browse the repository at this point in the history
fix #9430

Test Plan:
1. enable sync
2. visit https://www.google.com/#q=test
3. enable the setting to clear browsing history when Brave is closed in about:preferences#security
4. close and restart Brave
5. you should see 'Ignoring entry because we can't create site key' in the console but no errors
  • Loading branch information
diracdeltas committed Jun 13, 2017
1 parent 849f5fd commit d37ce0c
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 d37ce0c

Please sign in to comment.