diff --git a/backend/util/scoreAndSearch.js b/backend/util/scoreAndSearch.js index 14ba8c2..f0a486e 100644 --- a/backend/util/scoreAndSearch.js +++ b/backend/util/scoreAndSearch.js @@ -202,10 +202,10 @@ function createPeriod(from, to, currentMonth, currentYear) { function calculateScoreForPeriod(type, travelPeriods, region, searchLowParam, searchMaxParam) { // console.log('getScoreAndAverageFromClimate for', region.name, type) - const singleScores = travelPeriods.map(period => { + const singleScores = travelPeriods. map(period => { let res = { type: type, - value: region[type][period.month - 1], + value: region[type] !== null ? region[type][period.month - 1] : null, days: period.days }