added missing check

This commit is contained in:
Vladimir Matveev
2016-06-15 21:52:39 -07:00
parent c1d6a14a6b
commit a8dc65de19

View File

@@ -398,7 +398,7 @@ namespace ts.server {
getScriptInfo(fileName: string) {
const scriptInfo = this.projectService.getOrCreateScriptInfo(fileName, /*openedByClient*/ false);
if (!scriptInfo.defaultProject) {
if (scriptInfo && !scriptInfo.defaultProject) {
scriptInfo.defaultProject = this;
}
return scriptInfo;