Skip to content

Commit ca9c055

Browse files
committed
Fix nil
1 parent 24e52b4 commit ca9c055

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

internal/project/project.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,15 +341,14 @@ func (p *Project) GetLanguageServiceForRequest(ctx context.Context) (*ls.Languag
341341
if program == nil {
342342
panic("must have gced by other request")
343343
}
344-
checkerPool := p.checkerPool
345344
snapshot := &snapshot{
346345
project: p,
347346
positionEncoding: p.host.PositionEncoding(),
348347
program: program,
349348
}
350349
languageService := ls.NewLanguageService(ctx, snapshot)
351350
cleanup := func() {
352-
if checkerPool.isRequestCheckerInUse(core.GetRequestID(ctx)) {
351+
if p.checkerPool != nil && p.checkerPool.isRequestCheckerInUse(core.GetRequestID(ctx)) {
353352
panic(fmt.Errorf("checker for request ID %s not returned to pool at end of request", core.GetRequestID(ctx)))
354353
}
355354
}

0 commit comments

Comments
 (0)