Skip to content

Commit 95b8f11

Browse files
Keen Yee Liauayazhafiz
authored andcommitted
fix: check config file errors length (#407)
`configFileErrors` returned by `openClientFile()` is an empty array even if there's no error, so check for its length besides truthiness.
1 parent fb9e2f4 commit 95b8f11

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

server/src/session.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ export class Session {
145145
const result = this.projectService.openClientFile(filePath, text, scriptKind);
146146

147147
const {configFileName, configFileErrors} = result;
148-
if (configFileErrors) {
148+
if (configFileErrors && configFileErrors.length) {
149+
// configFileErrors is an empty array even if there's no error, so check length.
149150
this.connection.console.error(configFileErrors.map(e => e.messageText).join('\n'));
150151
}
151152
if (!configFileName) {

0 commit comments

Comments
 (0)