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

Commit

Permalink
Check for successful deserialize for TP and ad-block
Browse files Browse the repository at this point in the history
Auditors: @SergeyZhukovsky

Fix #6448

Fix #6449
  • Loading branch information
bbondy committed Jan 1, 2017
1 parent f17950e commit 884c121
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
12 changes: 10 additions & 2 deletions app/dataFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,16 @@ module.exports.init = (resourceName, startExtension, onInitDone, forceDownload)
// it's used directly
// console.log('done init:', resourceName)
cachedDataFiles[resourceName] = data
onInitDone(data)
startExtension()
if (onInitDone(data)) {
startExtension()
} else {
console.error(`Failed to deserialize data file for resource: ${resourceName}`)
fs.unlink(storagePath(url), (err) => {
if (err) {
console.error(`Could not remove unserializable data file for resource: ${resourceName}`)
}
})
}
}

const loadProcess = (resourceName, version) =>
Expand Down
1 change: 1 addition & 0 deletions app/httpsEverywhere.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ function loadRulesets (data) {
var parsedData = JSON.parse(data)
targets = parsedData.targets
db = parsedData.rulesetStrings
return true
}

/**
Expand Down

1 comment on commit 884c121

@SergeyZhukovsky
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++

Please sign in to comment.