Fix some error cases when the number of teams is zero

* There is no config.json
* config.teams.length === 0
This commit is contained in:
Yuya Ochiai
2016-01-14 23:27:37 +09:00
parent 267d0e3ded
commit 54f7eb3657
3 changed files with 18 additions and 2 deletions

View File

@@ -38,5 +38,13 @@ module.exports = {
}
var data = JSON.stringify(config, null, ' ');
fs.writeFileSync(configFile, data, 'utf8');
},
loadDefault: function() {
return {
teams: [],
hideMenuBar: false,
version: version
};
}
};