diff --git a/server/src/services/anomalyType.ts b/server/src/services/anomalyType.ts index bf23943..58d4937 100644 --- a/server/src/services/anomalyType.ts +++ b/server/src/services/anomalyType.ts @@ -37,6 +37,9 @@ let anomaliesNameToIdMap = {}; function loadAnomaliesMap() { let filename = path.join(ANOMALIES_PATH, `all_anomalies.json`); + if(!fs.existsSync(filename)) { + saveAnomaliesMap(); + } anomaliesNameToIdMap = getJsonDataSync(filename); }