grid focus fix

This commit is contained in:
Jan Prochazka
2021-03-10 22:02:54 +01:00
parent 54d17a67d4
commit 5f97f7d922
3 changed files with 15 additions and 3 deletions

View File

@@ -121,7 +121,13 @@ module.exports = {
getStats_meta: 'get',
getStats({ jslid }) {
const file = `${getJslFileName(jslid)}.stats`;
if (fs.existsSync(file)) return JSON.parse(fs.readFileSync(file, 'utf-8'));
if (fs.existsSync(file)) {
try {
return JSON.parse(fs.readFileSync(file, 'utf-8'));
} catch (e) {
return {};
}
}
return {};
},