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()
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 ) ; 
104106            if  ( ! File . Exists ( path ) ) 
@@ -152,6 +154,8 @@ public void ImportSourceFile(string path)
152154
153155        public  void  RemoveSafely ( IVBComponent  component ) 
154156        { 
157+             if  ( component . IsWrappingNullReference )  {  return ;  } 
158+ 
155159            switch  ( component . Type ) 
156160            { 
157161                case  ComponentType . ClassModule : 
@@ -174,7 +178,7 @@ private static void AttachEvents(VB.VBComponents components)
174178        { 
175179            lock  ( Locker ) 
176180            { 
177-                 if  ( _components  ==  null ) 
181+                 if  ( _components  ==  null   &&   components   !=   null ) 
178182                { 
179183                    _components  =  components ; 
180184                    _componentAdded  =  OnComponentAdded ; 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments