Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 4bd6706

Browse files
authored
Merge pull request #392 from github/fixes/391-trackingcollection-nre
Allow null param to CreateListenerCollection
2 parents 02bf074 + 6fe6ff2 commit 4bd6706

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/GitHub.Exports.Reactive/Collections/TrackingCollection.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
using System.Reactive.Linq;
1616
using System.Reactive.Subjects;
1717
using System.Threading;
18+
using System.Linq;
1819

1920
namespace GitHub.Collections
2021
{
@@ -46,7 +47,7 @@ public static ObservableCollection<T> CreateListenerCollection<T>(this ITracking
4647
IList<T> stickieItemsOnTop = null)
4748
where T : class, ICopyable<T>
4849
{
49-
var col = new ObservableCollection<T>(stickieItemsOnTop);
50+
var col = new ObservableCollection<T>(stickieItemsOnTop ?? Enumerable.Empty<T>());
5051
tcol.CollectionChanged += (s, e) =>
5152
{
5253
var offset = 0;

0 commit comments

Comments
 (0)