Skip to content

Commit

Permalink
Catch case where recurring item has no Start
Browse files Browse the repository at this point in the history
  • Loading branch information
rbuehlma committed Oct 17, 2017
1 parent 887adeb commit e185a49
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion net-core/Ical.Net/Ical.Net/Utility/RecurrenceUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public static void ClearEvaluation(IRecurrable recurrable)
public static HashSet<Occurrence> GetOccurrences(IRecurrable recurrable, IDateTime periodStart, IDateTime periodEnd, bool includeReferenceDateInResults)
{
var evaluator = recurrable.GetService(typeof (IEvaluator)) as IEvaluator;
if (evaluator == null)
if (evaluator == null || recurrable.Start == null)
{
return new HashSet<Occurrence>();
}
Expand Down
4 changes: 2 additions & 2 deletions v2/ical.NET/Utility/RecurrenceUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public static HashSet<Occurrence> GetOccurrences(IRecurrable recurrable, IDateTi
public static HashSet<Occurrence> GetOccurrences(IRecurrable recurrable, IDateTime periodStart, IDateTime periodEnd, bool includeReferenceDateInResults)
{
var evaluator = recurrable.GetService(typeof (IEvaluator)) as IEvaluator;
if (evaluator == null)
if (evaluator == null || recurrable.Start == null)
{
return new HashSet<Occurrence>();
}
Expand Down Expand Up @@ -95,4 +95,4 @@ where endTime.GreaterThan(periodStart) && p.StartTime.LessThanOrEqual(periodEnd)
}
}
}
}
}

0 comments on commit e185a49

Please sign in to comment.