File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Rubberduck.VBEEditor/SafeComWrappers/VBA Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -99,6 +99,8 @@ public override int GetHashCode()
99
99
100
100
public void ImportSourceFile ( string path )
101
101
{
102
+ if ( IsWrappingNullReference ) { return ; }
103
+
102
104
var ext = Path . GetExtension ( path ) ;
103
105
var name = Path . GetFileNameWithoutExtension ( path ) ;
104
106
if ( ! File . Exists ( path ) )
@@ -152,6 +154,8 @@ public void ImportSourceFile(string path)
152
154
153
155
public void RemoveSafely ( IVBComponent component )
154
156
{
157
+ if ( component . IsWrappingNullReference ) { return ; }
158
+
155
159
switch ( component . Type )
156
160
{
157
161
case ComponentType . ClassModule :
@@ -174,7 +178,7 @@ private static void AttachEvents(VB.VBComponents components)
174
178
{
175
179
lock ( Locker )
176
180
{
177
- if ( _components == null )
181
+ if ( _components == null && components != null )
178
182
{
179
183
_components = components ;
180
184
_componentAdded = OnComponentAdded ;
You can’t perform that action at this time.
0 commit comments