Index: calendar/gui/calendar-component.c
===================================================================
--- calendar/gui/calendar-component.c	(revision 35011)
+++ calendar/gui/calendar-component.c	(working copy)
@@ -566,20 +566,30 @@
 	cal = e_cal_model_get_client_for_uri (gnome_calendar_get_calendar_model (component_view->calendar), uri);
 	if (!cal)
 		cal = e_cal_new_from_uri (uri, E_CAL_SOURCE_TYPE_EVENT);
-	g_free (uri);
+
 	if (cal) {
-		if (e_cal_remove (cal, NULL)) {
-			if (e_source_selector_source_is_selected (E_SOURCE_SELECTOR (component_view->source_selector),
-								  selected_source)) {
-				gnome_calendar_remove_source (component_view->calendar, E_CAL_SOURCE_TYPE_EVENT, selected_source);
-				e_source_selector_unselect_source (E_SOURCE_SELECTOR (component_view->source_selector),
-								   selected_source);
-			}
+		GError *err = NULL;
 
-			e_source_group_remove_source (e_source_peek_group (selected_source), selected_source);
-			e_source_list_sync (component_view->source_list, NULL);
+		e_cal_remove (cal, &err);
+
+		if (err) {
+			g_message ("Cannot remove calendar %s: %s", uri, err->message);
+			g_error_free (err);
 		}
+	} else {
+		g_message ("Cannot find calendar '%s'", uri);
 	}
+
+	g_free (uri);
+
+	if (e_source_selector_source_is_selected (E_SOURCE_SELECTOR (component_view->source_selector), selected_source)) {
+		gnome_calendar_remove_source (component_view->calendar, E_CAL_SOURCE_TYPE_EVENT, selected_source);
+		e_source_selector_unselect_source (E_SOURCE_SELECTOR (component_view->source_selector),
+						   selected_source);
+	}
+
+	e_source_group_remove_source (e_source_peek_group (selected_source), selected_source);
+	e_source_list_sync (component_view->source_list, NULL);
 }
 
 static void
Index: calendar/ChangeLog
===================================================================
--- calendar/ChangeLog	(revision 35011)
+++ calendar/ChangeLog	(working copy)
@@ -1,3 +1,12 @@
+2008-02-14  Milan Crha  <mcrha@redhat.com>
+
+	** Fix for bug #515998
+
+	* gui/calendar-component.c: (delete_calendar_cb):
+	Delete source of the calendar from source list even we are not able
+	to find/create calendar at the moment. Also print error message
+	on the console in this case to see what is going wrong.
+
 2008-02-11  Srinivasa Ragavan  <sragavan@novell.com>
 
 	* gui/alarm-notify/alarm-notify.c: (alarm_notify_add_calendar): Google
