Skip to content

Commit 2549d61

Browse files
committed
Don't flow through to rest of codepath with Ast and ProjectEntry are null
1 parent 534468b commit 2549d61

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ internal void Analyze(DDG ddg, CancellationToken cancel) {
180180
long endTime = _sw.ElapsedMilliseconds;
181181
var thisTime = endTime - startTime;
182182
_analysisTime += thisTime;
183-
if (thisTime >= 500 || (_analysisTime / _analysisCount) > 500) {
183+
if (thisTime >= 500 || (_analysisTime / _analysisCount) > 500) {
184184
Trace.TraceWarning("Analyzed: {0} {1} ({2} count, {3}ms total, {4}ms mean)", this, thisTime, _analysisCount, _analysisTime, (double)_analysisTime / _analysisCount);
185185
}
186186
}
@@ -191,7 +191,7 @@ internal virtual void AnalyzeWorker(DDG ddg, CancellationToken cancel) {
191191
Debug.Assert(Ast != null, "Ast has unexpected null value");
192192
Debug.Assert(ProjectEntry != null, "ProjectEntry has unexpected null value");
193193

194-
if (Ast != null && ProjectEntry != null && Tree != ProjectEntry.Tree) {
194+
if (Ast == null || ProjectEntry == null || Tree != ProjectEntry.Tree) {
195195
// analysis unit properties are invalid or we were enqueued and a new version became available
196196
// don't re-analyze against the old version.
197197
return;

0 commit comments

Comments
 (0)