Skip to content

Commit 178f87d

Browse files
authored
Update VBProject.cs
Prevent wrappers from accessing VBComponents collection on a locked project. Ref. #3415.
1 parent 4670b27 commit 178f87d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Rubberduck.VBEEditor/SafeComWrappers/VBA/VBProject.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public IReferences References
6060

6161
public IVBComponents VBComponents
6262
{
63-
get { return new VBComponents(IsWrappingNullReference ? null : Target.VBComponents); }
63+
get { return new VBComponents(IsWrappingNullReference || Protection == ProjectProtection.Locked ? null : Target.VBComponents); }
6464
}
6565

6666
public ProjectProtection Protection
@@ -232,4 +232,4 @@ public string ProjectDisplayName
232232
}
233233
}
234234
}
235-
}
235+
}

0 commit comments

Comments
 (0)