dragonfly-science / bailiwick-ui

Bailiwick frontend
1 stars 1 forks source link

Indicator not loading #29

Closed simonwinter closed 5 years ago

simonwinter commented 5 years ago

When I click on School leavers by ncea level, the page hangs & we get the following error:

ghc: Prelude.maximum: empty list

simonwinter commented 5 years ago

I think this may be that we're passing an empty list (IndicatorYears on the Indicator) to the makeGoto function in View/Indicators.hs:

makeGoto Indicator{..} routeD = do
  route <- routeD
  let myear = themePageYear <$> getThemePage route
      year = case myear of
                Just y -> if y `elem` indicatorYears
                            then y
                            else maximum indicatorYears
                Nothing -> maximum indicatorYears