From 2f2683b105229dc79734dd84149450a5d43bb4e4 Mon Sep 17 00:00:00 2001 From: Petr Spacek Date: Mon, 18 Sep 2023 09:31:34 +0200 Subject: [PATCH] fix:undefined error in mergingResult.problemArgs --- src/languageservice/parser/jsonParser07.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/languageservice/parser/jsonParser07.ts b/src/languageservice/parser/jsonParser07.ts index a9bb2d48..b4fdfe4b 100644 --- a/src/languageservice/parser/jsonParser07.ts +++ b/src/languageservice/parser/jsonParser07.ts @@ -400,7 +400,7 @@ export class ValidationResult { (problemType !== ProblemType.missingRequiredPropWarning || isArrayEqual(p.problemArgs, bestResult.problemArgs)) // missingProp is merged only with same problemArg ); if (mergingResult) { - if (mergingResult.problemArgs.length) { + if (mergingResult.problemArgs?.length) { mergingResult.problemArgs .filter((p) => !bestResult.problemArgs.includes(p)) .forEach((p) => bestResult.problemArgs.push(p));