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 6aebdfb
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions net-core/Ical.Net/Ical.Net.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Ical.Net</id>
<version>3.0.12</version>
<version>3.0.13</version>
<title>Ical.Net</title>
<authors>Rian Stockbower, Douglas Day, M. David Peterson</authors>
<owners>Rian Stockbower</owners>
Expand Down Expand Up @@ -30,4 +30,4 @@
<file src="Ical.Net\bin\Release\netstandard1.3\antlr.runtime.xml" target="lib\netstandard1.3\antlr.runtime.xml" />
<file src="Ical.Net\bin\Release\netstandard1.3\Ical.Net.deps.json" target="lib\netstandard1.3\Ical.Net.deps.json" />
</files>
</package>
</package>
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
2 changes: 2 additions & 0 deletions release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
A listing of what each [Nuget package](https://www.nuget.org/packages/Ical.Net) version represents.

### v3
* 3.0.13: Fix if DTSTART is not set for VTODO
* 3.0.12: Several improvements rolled up:
* `CalendarEvent` now considers Summary and Description for equality and hashing. [PR 309](https://github.com/rianjs/ical.net/pull/309).
* Protection against `InvalidOperationException`s in some collections usage scenarios [PR 312](https://github.com/rianjs/ical.net/pull/312)
Expand All @@ -20,6 +21,7 @@ A listing of what each [Nuget package](https://www.nuget.org/packages/Ical.Net)

### v2

* 2.3.4: Fix if DTSTART is not set for VTODO
* 2.3.3: Several improvements rolled up:
* `Event` now considers Summary and Description for equality and hashing. [PR 309](https://github.com/rianjs/ical.net/pull/309).
* Protection against `InvalidOperationException`s in some collections usage scenarios [PR 312](https://github.com/rianjs/ical.net/pull/312)
Expand Down
4 changes: 2 additions & 2 deletions v2/Ical.Net.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Ical.Net</id>
<version>2.3.3</version>
<version>2.3.4</version>
<title>Ical.Net</title>
<authors>Rian Stockbower, Douglas Day, M. David Peterson</authors>
<owners>Rian Stockbower</owners>
Expand Down Expand Up @@ -46,4 +46,4 @@
<file src="Ical.Net\bin\Release\net40\antlr.runtime.pdb" target="lib\net40\antlr.runtime.pdb" />
<file src="Ical.Net\bin\Release\net40\antlr.runtime.xml" target="lib\net40\antlr.runtime.xml" />
</files>
</package>
</package>
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 6aebdfb

Please sign in to comment.