Skip to content

Commit d41ac8a

Browse files
committed
Add null check and CR feedback
1 parent 0e96c5e commit d41ac8a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/compiler/parser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,14 +441,14 @@ namespace ts {
441441
/* @internal */
442442
export function parseIsolatedJSDocComment(content: string, start?: number, length?: number) {
443443
const result = Parser.JSDocParser.parseIsolatedJSDocComment(content, start, length);
444-
if (result.jsDocComment) {
444+
if (result && result.jsDocComment) {
445445
// because the jsDocComment was parsed out of the source file, it might
446446
// not be covered by the fixupParentReferences.
447447
let parentNode: Node = result.jsDocComment;
448448
forEachChild(result.jsDocComment, visitNode);
449449

450450
function visitNode(n: Node): void {
451-
if (n.parent !== parentNode) {
451+
if (n.parent === undefined) {
452452
n.parent = parentNode;
453453

454454
const saveParent = parentNode;

0 commit comments

Comments
 (0)