diff --git a/server/routes/alerts-and-warnings.js b/server/routes/alerts-and-warnings.js index 0e0425b9a..6999b2635 100644 --- a/server/routes/alerts-and-warnings.js +++ b/server/routes/alerts-and-warnings.js @@ -40,7 +40,9 @@ async function routeHandler (request, h) { if (hasInvalidCharacters(location, request.query.q)) { return renderNotFound(location) - } else if (!location) { + } + + if (!location) { const data = await request.server.methods.flood.getFloods() floods = new Floods(data) model = new ViewModel({ location, floods }) diff --git a/server/routes/river-and-sea-levels.js b/server/routes/river-and-sea-levels.js index b88df4319..f4da4b858 100644 --- a/server/routes/river-and-sea-levels.js +++ b/server/routes/river-and-sea-levels.js @@ -69,7 +69,9 @@ async function locationQueryHandler (request, h) { if (hasInvalidCharacters(location, request.query.q)) { return renderNotFound(location) - } else if (!location) { + } + + if (!location) { return h.view(route, { model: emptyResultsModel() }) }