From 5787300b87ed5074642166b8dc0493266a787dea Mon Sep 17 00:00:00 2001 From: Matthew Oslan Date: Fri, 12 Jul 2019 19:43:25 -0400 Subject: [PATCH] Silently fallback to default WeatherProvider if PWS key is omitted --- routes/weather.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/routes/weather.ts b/routes/weather.ts index c8feb0c..694438c 100644 --- a/routes/weather.ts +++ b/routes/weather.ts @@ -219,11 +219,7 @@ export const getWateringData = async function( req: express.Request, res: expres // Parse the PWS information. let pws: PWS | undefined = undefined; - if ( adjustmentOptions.pws ) { - if ( !adjustmentOptions.key ) { - res.send("Error: An API key must be provided when using a PWS."); - return; - } + if ( adjustmentOptions.pws && adjustmentOptions.key ) { const idMatch = adjustmentOptions.pws.match( /^pws:([a-zA-Z\d]+)$/ ); const pwsId = idMatch ? idMatch[ 1 ] : undefined;