Skip to content

Commit 095fd17

Browse files
committed
Fix nil exception on inferred projects
1 parent 1971964 commit 095fd17

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

internal/project/project.go

+6-4
Original file line numberDiff line numberDiff line change
@@ -279,10 +279,12 @@ func (p *Project) updateWatchers() {
279279
rootFileGlobs := p.getRootFileWatchGlobs()
280280
failedLookupGlobs, affectingLocationGlobs := p.getModuleResolutionWatchGlobs()
281281

282-
if updated, err := p.rootFilesWatch.update(rootFileGlobs); err != nil {
283-
p.log(fmt.Sprintf("Failed to update root file watch: %v", err))
284-
} else if updated {
285-
p.log("Root file watches updated:\n" + formatFileList(rootFileGlobs, "\t", hr))
282+
if rootFileGlobs != nil {
283+
if updated, err := p.rootFilesWatch.update(rootFileGlobs); err != nil {
284+
p.log(fmt.Sprintf("Failed to update root file watch: %v", err))
285+
} else if updated {
286+
p.log("Root file watches updated:\n" + formatFileList(rootFileGlobs, "\t", hr))
287+
}
286288
}
287289

288290
if updated, err := p.failedLookupsWatch.update(failedLookupGlobs); err != nil {

0 commit comments

Comments
 (0)