提交 bd9ecb2d 编写于 作者: D Daniel Imms

Remove redundant fs.existsSync call

Fixes #14066
上级 0db499d1
......@@ -104,13 +104,9 @@ export class BackupService implements IBackupService {
}
private loadSync(): void {
if (fs.existsSync(this.backupWorkspacesPath)) {
try {
this.fileContent = JSON.parse(fs.readFileSync(this.backupWorkspacesPath, 'utf8').toString()); // invalid JSON or permission issue can happen here
} catch (error) {
this.fileContent = Object.create(null);
}
} else {
try {
this.fileContent = JSON.parse(fs.readFileSync(this.backupWorkspacesPath, 'utf8').toString()); // invalid JSON or permission issue can happen here
} catch (error) {
this.fileContent = Object.create(null);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册