quick-add-popover: Only remove existing rows

We can receive the source-changed signal on read-only sources,
and these sources have no row associated. Trying to remove the
non-existing row would yield a warning.
This commit is contained in:
Georges Basile Stavracas Neto
2018-01-28 12:45:57 -02:00
parent f698981aa8
commit 09b986f526
+3 -1
View File
@@ -536,7 +536,9 @@ on_source_changed (GcalManager *manager,
/* If the calendar changed from/to read-only, we add or remove it here */
if (!gcal_manager_is_client_writable (self->manager, source))
{
gtk_container_remove (GTK_CONTAINER (self->calendars_listbox), row);
if (row)
gtk_container_remove (GTK_CONTAINER (self->calendars_listbox), row);
return;
}
else if (!row)