Skip to content
This repository has been archived by the owner on Jan 6, 2022. It is now read-only.

Commit

Permalink
fix: avoid the screen white-out.
Browse files Browse the repository at this point in the history
Set to ignore the invalid stored json.
  • Loading branch information
AtuyL committed Nov 23, 2018
1 parent aaafee7 commit f53397a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/actions/dat-middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -382,13 +382,13 @@ export default class DatMiddleware {
} catch (_) {
return
}
const datOpts = JSON.parse(blob)
const datOpts = JSON.parse(blob || '{}')

blob = {}
blob = null
try {
blob = await readFile(joinPath(this.dataDir, 'paused.json'), 'utf8')
} catch (_) {}
const paused = JSON.parse(blob)
const paused = JSON.parse(blob || '{}')

for (const key of Object.keys(datOpts)) {
const opts = JSON.parse(datOpts[key])
Expand Down

0 comments on commit f53397a

Please sign in to comment.