From f0780c2906c7235714bc0a4a87ee72f123d40067 Mon Sep 17 00:00:00 2001 From: Samer Albahra Date: Sun, 20 May 2018 17:58:40 -0500 Subject: [PATCH] Fix missing precip data from OWM --- routes/weather.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routes/weather.js b/routes/weather.js index cb2d25a..caebfb6 100755 --- a/routes/weather.js +++ b/routes/weather.js @@ -239,7 +239,7 @@ function getOWMWeatherData( location, callback ) { weather.temp = parseInt( data.list[ 0 ].main.temp ); weather.humidity = parseInt( data.list[ 0 ].main.humidity ); weather.wind = parseInt( data.list[ 0 ].wind.speed ); - weather.precip = parseFloat( data.list[ 0 ].rain[ "3h" ] ); + weather.precip = data.list[ 0 ].rain ? parseFloat( data.list[ 0 ].rain[ "3h" ] ) : ""; location = location.join( "," );