Ignore JSON.parse expections on PermissionManager constructor

https://github.com/mattermost/desktop/pull/633#issuecomment-342508014
This commit is contained in:
Yuya Ochiai
2017-11-08 00:44:15 +09:00
parent 30da348e6e
commit 4137df4098

View File

@@ -9,7 +9,12 @@ class PermissionManager {
constructor(file) {
this.file = file;
if (fs.existsSync(file)) {
try {
this.permissions = JSON.parse(fs.readFileSync(this.file, 'utf-8'));
} catch (err) {
console.error(err);
this.permissions = {};
}
} else {
this.permissions = {};
}