@@ -1735,6 +1735,10 @@ function findExpressionCompleteTarget(code) {
|
1735 | 1735 | // what we can potentially complete on, so let's re-run the function's logic on that |
1736 | 1736 | if (lastBodyStatement.type === 'VariableDeclaration') { |
1737 | 1737 | const lastDeclarationInit = lastBodyStatement.declarations.at(-1).init; |
| 1738 | +if (!lastDeclarationInit) { |
| 1739 | +// If there is no initialization we can simply return |
| 1740 | +return null; |
| 1741 | +} |
1738 | 1742 | const lastDeclarationInitCode = code.slice(lastDeclarationInit.start, lastDeclarationInit.end); |
1739 | 1743 | return findExpressionCompleteTarget(lastDeclarationInitCode); |
1740 | 1744 | } |
|