[gnome-calendar/mcatanzaro/#299-gnome-3-34: 12/12] Avoid crashing when year view's weather icon is NULL



commit 020022b42d5762363abcce64f80815d621497d3b
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Wed Jul 3 18:50:49 2019 -0500

    Avoid crashing when year view's weather icon is NULL
    
    This is not a proper solution, because I don't see how it could possibly
    ever be NULL here. But a huge number of users are reporting this crash,
    so we have to try something.
    
    This fixes #299, but I'm not happy with it.

 src/views/gcal-year-view.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/src/views/gcal-year-view.c b/src/views/gcal-year-view.c
index d32bc0d8..5c6ec89c 100644
--- a/src/views/gcal-year-view.c
+++ b/src/views/gcal-year-view.c
@@ -2192,7 +2192,11 @@ update_weather (GcalYearView *self)
   if (!updated)
     {
       gtk_label_set_text (self->temp_label, "");
-      gtk_image_clear (self->weather_icon);
+      /* FIXME: This should never be NULL, but it somehow is.
+       * https://gitlab.gnome.org/GNOME/gnome-calendar/issues/299
+       */
+      if (self->weather_icon != NULL)
+        gtk_image_clear (self->weather_icon);
     }
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]