File tree 1 file changed +7
-2
lines changed
Nodejs/Product/Analysis/Analysis/Analyzer
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -193,8 +193,10 @@ internal void Analyze(DDG ddg, CancellationToken cancel) {
193
193
internal virtual void AnalyzeWorker ( DDG ddg , CancellationToken cancel ) {
194
194
Debug . Assert ( Ast != null , "Ast has unexpected null value" ) ;
195
195
Debug . Assert ( ProjectEntry != null , "ProjectEntry has unexpected null value" ) ;
196
+ Debug . Assert ( DeclaringModuleEnvironment != null , "DeclaringModuleEnvironment has unexpected null value" ) ;
197
+ Debug . Assert ( DeclaringModuleEnvironment . GlobalEnvironment != null , "DeclaringModuleEnvironment.GlobalEnvironment has unexpected null value" ) ;
196
198
197
- if ( Ast == null || ProjectEntry == null || Tree != ProjectEntry . Tree ) {
199
+ if ( Ast == null || ProjectEntry == null || Tree != ProjectEntry . Tree || DeclaringModuleEnvironment == null ) {
198
200
// analysis unit properties are invalid or we were enqueued and a new version became available
199
201
// don't re-analyze against the old version.
200
202
return ;
@@ -216,7 +218,10 @@ internal virtual void AnalyzeWorker(DDG ddg, CancellationToken cancel) {
216
218
}
217
219
218
220
foreach ( var nameValue in toRemove ) {
219
- DeclaringModuleEnvironment . GlobalEnvironment . RemoveVariable ( nameValue . Key ) ;
221
+ var globalEnvironment = DeclaringModuleEnvironment . GlobalEnvironment ;
222
+ if ( globalEnvironment != null ) {
223
+ globalEnvironment . RemoveVariable ( nameValue . Key ) ;
224
+ }
220
225
221
226
// if anyone read this value it could now be gone (e.g. user
222
227
// deletes a class definition) so anyone dependent upon it
You can’t perform that action at this time.
0 commit comments