[libgweather/wip/hadess/serialisation-fix-stable: 1/13] weather: Fix infinite loop for location without a valid long/lat
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgweather/wip/hadess/serialisation-fix-stable: 1/13] weather: Fix infinite loop for location without a valid long/lat
- Date: Thu, 18 Oct 2018 10:17:00 +0000 (UTC)
commit 0e334a7b950fdcd8484ee88bd8411dac1c6201e2
Author: Bastien Nocera <hadess hadess net>
Date: Mon Oct 8 12:25:20 2018 +0200
weather: Fix infinite loop for location without a valid long/lat
Don't try to calculate the sunset/sunrise times for GWeatherLocations
without a valid long/lat, such as named timezones.
Closes: #5
libgweather/weather-sun.c | 3 +++
1 file changed, 3 insertions(+)
---
diff --git a/libgweather/weather-sun.c b/libgweather/weather-sun.c
index d7983b1..e3960f1 100644
--- a/libgweather/weather-sun.c
+++ b/libgweather/weather-sun.c
@@ -293,6 +293,9 @@ _gweather_info_ensure_sun (GWeatherInfo *info)
priv = info->priv;
+ if (!info->priv->location.latlon_valid)
+ return;
+
if (!priv->sunriseValid && !priv->sunsetValid)
calc_sun (info, priv->current_time);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]