[libgweather/wip/hadess/3.28.3: 3/10] weather: Fix infinite loop for location without a valid long/lat



commit 3a46308336dc62c6547a90155141872fcc951557
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]