hotfix: search handles null values instead of arrays full of nulls

This commit is contained in:
Timo John 2020-06-25 15:15:04 +02:00
parent 85efd83485
commit 7a6be53e0b

View File

@ -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
}