Commit 3955a69a1b6f10b1a554d79c7b9fda097c5ab783
1 parent
cc6b1f0d
fix: FileAdapter missing default config causes startup crash
Showing
1 changed file
with
2 additions
and
2 deletions
server/services/datasource-service.js
| ... | ... | @@ -102,10 +102,10 @@ class MockAdapter extends DataSourceAdapter { |
| 102 | 102 | // ════════════════════════════════════════ |
| 103 | 103 | |
| 104 | 104 | class FileAdapter extends DataSourceAdapter { |
| 105 | - constructor(config) { | |
| 105 | + constructor(config = {}) { | |
| 106 | 106 | super(config); |
| 107 | 107 | this.name = 'file'; |
| 108 | - this.dataDir = config.dataDir || path.join(DATA_DIR, '_datasources'); | |
| 108 | + this.dataDir = (config && config.dataDir) || path.join(DATA_DIR, '_datasources'); | |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | async fetchMetrics({ startDate, endDate }) { | ... | ... |