Don't crash, when broken SVR.JS config is loaded.
This commit is contained in:
parent
1841266ad2
commit
fd10bb6409
1 changed files with 7 additions and 1 deletions
8
index.js
8
index.js
|
@ -11,7 +11,13 @@ try {
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
// Can't determine version
|
// Can't determine version
|
||||||
}
|
}
|
||||||
var configJSONS = JSON.parse(fs.readFileSync(__dirname + "/../../../config.json")); // Read configuration JSON
|
var configJSONS = {};
|
||||||
|
try {
|
||||||
|
configJSONS = JSON.parse(fs.readFileSync(__dirname + "/../../../config.json")); // Read configuration JSON
|
||||||
|
} catch(ex) {
|
||||||
|
//OrangeCircle will not care about configJSONS in SVR.JS 3.x and newer
|
||||||
|
//SVR.JS 2.x and older will fail to start with broken configuration file anyway...
|
||||||
|
}
|
||||||
var scgiConf = {};
|
var scgiConf = {};
|
||||||
try {
|
try {
|
||||||
scgiConf = JSON.parse(fs.readFileSync(__dirname + "/../../../orangecircle-config.json"));
|
scgiConf = JSON.parse(fs.readFileSync(__dirname + "/../../../orangecircle-config.json"));
|
||||||
|
|
Loading…
Reference in a new issue