import-dialog: Only search for non-NULL default calendars

The default calendar might be NULL during the initial loading,
protect against that.

Fixes https://gitlab.gnome.org/GNOME/gnome-calendar/-/issues/813
This commit is contained in:
Georges Basile Stavracas Neto
2022-03-07 14:37:01 -03:00
parent 8790fb9f58
commit 9520a2b5c1
+1 -1
View File
@@ -106,7 +106,7 @@ update_default_calendar (GcalImportDialog *self)
calendars = gcal_manager_get_calendars_model (manager);
default_calendar = gcal_manager_get_default_calendar (manager);
if (g_list_store_find (G_LIST_STORE (calendars), default_calendar, &position))
if (default_calendar && g_list_store_find (G_LIST_STORE (calendars), default_calendar, &position))
adw_combo_row_set_selected (self->calendar_combo_row, position);
}