Skip to content

Commit 43e0414

Browse files
committed
fixes #2367
1 parent 5cb0c52 commit 43e0414

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Rubberduck.VBEEditor/Events/Sinks.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public void Stop()
5656

5757
private void RegisterComponentsEventSink(IVBComponents components, string projectId)
5858
{
59-
if (_componentsEventsSinks.ContainsKey(projectId))
59+
if (projectId == null || _componentsEventsSinks.ContainsKey(projectId))
6060
{
6161
// already registered - this is caused by the initial load+rename of a project in the VBE
6262
return;
@@ -77,7 +77,7 @@ private void RegisterComponentsEventSink(IVBComponents components, string projec
7777

7878
private void UnregisterComponentsEventSink(string projectId)
7979
{
80-
if (!_componentsEventsSinks.ContainsKey(projectId)) { return; }
80+
if (projectId == null || !_componentsEventsSinks.ContainsKey(projectId)) { return; }
8181

8282
var componentEventSink = _componentsEventsSinks[projectId];
8383
var info = _componentEventsInfo[projectId];

0 commit comments

Comments
 (0)