mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-06 12:31:33 +01:00
added try..catch to server parsing of translations, in case a file has a syntax error -- #1401
This commit is contained in:
@@ -220,7 +220,12 @@
|
||||
return winston.error(err.message);
|
||||
}
|
||||
|
||||
callback(JSON.parse(data.toString()));
|
||||
try {
|
||||
callback(JSON.parse(data.toString()));
|
||||
} catch (e) {
|
||||
winston.error('Could not parse `' + filename + '.json`, syntax error? Skipping...');
|
||||
callback({});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user