Skip to content

Commit

Permalink
Fix non-exsisting arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
ombakke committed Sep 11, 2014
1 parent 96c621a commit b9c5e92
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions KS.Umbraco7.Calendar.Core/Calendar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,20 @@ private static List<CalendarEvent> getEventList(DateTime startDate, DateTime end
if (e.exceptDates == null) {
e.exceptDates = new List<DateTime>();
}
if ((startDate <= e.startDate || (e.recurrence > 1 && !(e.recurUntil.HasValue && e.recurUntil <= startDate)) && e.startDate <= endDate))
if (e.days == null) {
e.days = new int?[0];
}
if (e.months == null) {
e.months = new int?[0];
}
if ((startDate <= e.startDate || (e.recurrence > 1 && !(e.recurUntil.HasValue && e.recurUntil.Value <= startDate)) && e.startDate <= endDate))
{
int durationMinutes = 0;
if (e.endDate.HasValue) {
durationMinutes = (int)e.endDate.Value.Subtract(e.startDate).TotalMinutes;
}

DateTime eEndDate = (e.recurUntil == null ? endDate : (e.recurUntil.Value < endDate ? e.recurUntil.Value.AddDays(1).AddSeconds(-1) : endDate));
DateTime eEndDate = (!e.recurUntil.HasValue ? endDate : (e.recurUntil.Value < endDate ? e.recurUntil.Value.AddDays(1).AddSeconds(-1) : endDate));
e.content = node;
switch (e.recurrence)
{
Expand Down

0 comments on commit b9c5e92

Please sign in to comment.