summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2018-10-08 12:27:14 +0200
committerBastien Nocera <hadess@hadess.net>2018-10-18 12:10:42 +0200
commitd9a73ee41523449df84737ba94f4b0a2421391aa (patch)
treeb85eb01559afb76ae943db7f78bcffb555b2e7a6
parent0e334a7b950fdcd8484ee88bd8411dac1c6201e2 (diff)
downloadlibgweather-d9a73ee41523449df84737ba94f4b0a2421391aa.tar.gz
weather: Consider moon phases to not be available for named timezones
Don't return a moon phase that's marked as valid for GWeatherLocations without a valid long/lat.
-rw-r--r--libgweather/weather-moon.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libgweather/weather-moon.c b/libgweather/weather-moon.c
index 993cdff..01466b1 100644
--- a/libgweather/weather-moon.c
+++ b/libgweather/weather-moon.c
@@ -141,6 +141,9 @@ _gweather_info_ensure_moon (GWeatherInfo *info)
priv = info->priv;
+ if (!info->priv->location.latlon_valid)
+ return;
+
if (!priv->moonValid)
priv->moonValid = calc_moon_internal (priv->current_time,
&priv->moonphase,