-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CalendarCollection.GetOccurrences throws "Collection was modified; enumeration operation may not execute." #148
Comments
Do you have an example of the code that caused the exception to be thrown? Commentary for my future self: I find it weird that asking questions about occurrences is allowed at the |
doing
throws same. It also happens if using |
Was there a resolution or a workaround for this problem? |
If you do a .toList() on the internal selector, it doesn't crash anymore:
But I don't think code itself makes sense.. it removes overridden recurrences if their time didn't change. But what if the description/title etc. changed? I'll create a separate issue for this. |
I have a similar issue in 2.2.18 where it throws the same exception.
|
at System.Collections.Generic.HashSet
1.Enumerator.MoveNext() at System.Linq.Enumerable.WhereEnumerableIterator
1.MoveNext()at System.Collections.Generic.HashSet
1.ExceptWith(IEnumerable
1 other)at Ical.Net.Calendar.GetOccurrences[T](IDateTime startTime, IDateTime endTime) in C:\dev\ical.net\ical.NET\Calendar.cs:line 406
at Ical.Net.Calendar.GetOccurrences(DateTime startTime, DateTime endTime) in C:\dev\ical.net\ical.NET\Calendar.cs:line 370
at Ical.Net.CalendarCollection.GetOccurrences(DateTime startTime, DateTime endTime) in C:\dev\ical.net\ical.NET\CalendarCollection.cs:line 60
for ical of this form:
BEGIN:VCALENDAR
PRODID:-//Google Inc//Google Calendar 70.9054//EN
VERSION:2.0
CALSCALE:GREGORIAN
METHOD:PUBLISH
X-WR-CALNAME:name
X-WR-TIMEZONE:America/New_York
BEGIN:VTIMEZONE
TZID:America/New_York
X-LIC-LOCATION:America/New_York
BEGIN:DAYLIGHT
TZOFFSETFROM:-0500
TZOFFSETTO:-0400
TZNAME:EDT
DTSTART:19700308T020000
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:-0400
TZOFFSETTO:-0500
TZNAME:EST
DTSTART:19701101T020000
RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
DTSTART;TZID=America/New_York:20161011T170000
DTEND;TZID=America/New_York:20161011T180000
DTSTAMP:20160930T115710Z
UID:blablabla
RECURRENCE-ID;TZID=America/New_York:20161011T170000
CREATED:20160830T144559Z
DESCRIPTION:
LAST-MODIFIED:20160928T142659Z
LOCATION:Location1
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:Summary1
TRANSP:OPAQUE
END:VEVENT
END:VCALENDAR
Using 2.2.14
The text was updated successfully, but these errors were encountered: