Skip to content

Commit 7a8f420

Browse files
committed
VBComponents:
- Changes following CR
1 parent a2971ea commit 7a8f420

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Rubberduck.VBEEditor/SafeComWrappers/VBA/VBComponents.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,11 @@ public override int GetHashCode()
9999

100100
public void ImportSourceFile(string path)
101101
{
102+
if (IsWrappingNullReference) { return; }
103+
102104
var ext = Path.GetExtension(path);
103105
var name = Path.GetFileNameWithoutExtension(path);
104-
if (!File.Exists(path) || this[name] == null)
106+
if (!File.Exists(path))
105107
{
106108
return;
107109
}
@@ -152,8 +154,7 @@ public void ImportSourceFile(string path)
152154

153155
public void RemoveSafely(IVBComponent component)
154156
{
155-
if (component == null)
156-
{ return; }
157+
if (component.IsWrappingNullReference) { return; }
157158

158159
switch (component.Type)
159160
{

0 commit comments

Comments
 (0)