Skip to content

Commit 078f5a4

Browse files
committed
fixes #2369
1 parent d4a6301 commit 078f5a4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Rubberduck.VBEEditor/SafeComWrappers/ComWrapperEnumerator.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Collections;
33
using System.Collections.Generic;
4+
using System.Linq;
45

56
namespace Rubberduck.VBEditor.SafeComWrappers
67
{
@@ -13,7 +14,9 @@ public class ComWrapperEnumerator<TWrapperItem> : IEnumerator<TWrapperItem>
1314
public ComWrapperEnumerator(IEnumerable source, Func<object, TWrapperItem> itemWrapper)
1415
{
1516
_itemWrapper = itemWrapper;
16-
_internal = source.GetEnumerator();
17+
_internal = source == null
18+
? Enumerable.Empty<TWrapperItem>().GetEnumerator()
19+
: source.GetEnumerator();
1720
}
1821

1922
public void Dispose()

0 commit comments

Comments
 (0)