gui/event-widget: Protect against NULL events
GcalEventWidget was adjusted to handle NULL events so it could more easily be used in GtkListView & family, however, what was left out of thie adjustment were the functions related to the orientation of the event. Protect these functions by only running them when an event widget is around. Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/809>
This commit is contained in:
committed by
Zelda Ahmed
parent
55d9cc68bc
commit
c1b689dbda
@@ -605,9 +605,12 @@ gcal_event_widget_set_property (GObject *object,
|
||||
|
||||
case PROP_ORIENTATION:
|
||||
self->orientation = g_value_get_enum (value);
|
||||
gcal_event_widget_update_orientation_widgets (self);
|
||||
gcal_event_widget_update_style (self);
|
||||
gcal_event_widget_update_timestamp (self);
|
||||
if (self->event)
|
||||
{
|
||||
gcal_event_widget_update_orientation_widgets (self);
|
||||
gcal_event_widget_update_style (self);
|
||||
gcal_event_widget_update_timestamp (self);
|
||||
}
|
||||
g_object_notify (object, "orientation");
|
||||
break;
|
||||
|
||||
@@ -1000,6 +1003,7 @@ gcal_event_widget_set_event (GcalEventWidget *self,
|
||||
g_signal_group_set_target (self->event_signal_group, event);
|
||||
|
||||
update_color (self);
|
||||
gcal_event_widget_update_orientation_widgets (self);
|
||||
gcal_event_widget_set_event_tooltip (self, event);
|
||||
gcal_event_widget_update_style (self);
|
||||
gcal_event_widget_update_timestamp (self);
|
||||
|
||||
Reference in New Issue
Block a user