Don't crash, when broken SVR.JS config is loaded.
This commit is contained in:
parent
b95ceeee75
commit
d7409cac1c
1 changed files with 7 additions and 2 deletions
9
index.js
9
index.js
|
@ -12,8 +12,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) {
|
||||||
|
//YellowSquare 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...
|
||||||
|
}
|
||||||
class RequestBodyStream extends stream.Readable {
|
class RequestBodyStream extends stream.Readable {
|
||||||
constructor(sourceStream) {
|
constructor(sourceStream) {
|
||||||
super();
|
super();
|
||||||
|
|
Loading…
Reference in a new issue