Skip to content

Commit f0d68f9

Browse files
committed
Merge pull request #526 from mousetraps/i70
#70 Visual Studio crashes when I quit debugging
2 parents 8a770b1 + 2549d61 commit f0d68f9

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

Nodejs/Product/Analysis/Analysis/Analyzer/AnalysisUnit.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,17 +183,20 @@ internal void Analyze(DDG ddg, CancellationToken cancel) {
183183
long endTime = _sw.ElapsedMilliseconds;
184184
var thisTime = endTime - startTime;
185185
_analysisTime += thisTime;
186-
if (thisTime >= 500 || (_analysisTime / _analysisCount) > 500) {
186+
if (thisTime >= 500 || (_analysisTime / _analysisCount) > 500) {
187187
Trace.TraceWarning("Analyzed: {0} {1} ({2} count, {3}ms total, {4}ms mean)", this, thisTime, _analysisCount, _analysisTime, (double)_analysisTime / _analysisCount);
188188
}
189189
}
190190
#endif
191191
}
192192

193193
internal virtual void AnalyzeWorker(DDG ddg, CancellationToken cancel) {
194-
if (Tree != ProjectEntry.Tree) {
195-
// we were enqueued and a new version became available, don't re-analyze against
196-
// the old version.
194+
Debug.Assert(Ast != null, "Ast has unexpected null value");
195+
Debug.Assert(ProjectEntry != null, "ProjectEntry has unexpected null value");
196+
197+
if (Ast == null || ProjectEntry == null || Tree != ProjectEntry.Tree) {
198+
// analysis unit properties are invalid or we were enqueued and a new version became available
199+
// don't re-analyze against the old version.
197200
return;
198201
}
199202

Nodejs/Product/Analysis/Analysis/VariableDef.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ protected virtual void ExceedsTypeLimit() {
180180
if (type.Value == null) {
181181
continue;
182182
}
183-
if (analyzer == null && type.Value.DeclaringModule != null) {
183+
if (analyzer == null && type.Value != null && type.Value.DeclaringModule != null) {
184184
analyzer = type.Value.DeclaringModule.Analysis.ProjectState;
185185
}
186186
var str = type.ToString();

0 commit comments

Comments
 (0)