Skip to content

Commit 8a2d161

Browse files
author
Andy Hanson
committed
Remove unnecessary assert
1 parent 65b1cf6 commit 8a2d161

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/server/scriptInfo.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,7 @@ namespace ts.server {
8484
}
8585

8686
getDefaultProject() {
87-
if (this.containingProjects.length === 0) {
88-
return Errors.ThrowNoProject();
89-
}
90-
Debug.assert(this.containingProjects.length !== 0);
91-
return this.containingProjects[0];
87+
return this.containingProjects.length === 0 ? Errors.ThrowNoProject() : this.containingProjects[0];
9288
}
9389

9490
setFormatOptions(formatSettings: FormatCodeSettings): void {

0 commit comments

Comments
 (0)