mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 04:43:37 -05:00
Fix bug: IfStatement#elseStatement can be undefined (#23467)
This commit is contained in:
@@ -21,7 +21,7 @@ namespace ts.OutliningElementsCollector {
|
||||
if (span) out.push(span);
|
||||
|
||||
depthRemaining--;
|
||||
if (isIfStatement(n) && isIfStatement(n.elseStatement)) {
|
||||
if (isIfStatement(n) && n.elseStatement && isIfStatement(n.elseStatement)) {
|
||||
// Consider an 'else if' to be on the same depth as the 'if'.
|
||||
walk(n.expression);
|
||||
walk(n.thenStatement);
|
||||
|
||||
Reference in New Issue
Block a user