Skip to content

Commit 77ea74f

Browse files
Copilotjakebailey
andauthored
Fix nil pointer dereference in code actions when diagnostic code is nil (#2091)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com>
1 parent 7ebe277 commit 77ea74f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/ls/codeactions.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func (l *LanguageService) ProvideCodeActions(ctx context.Context, params *lsprot
6464
// Process diagnostics in the context to generate quick fixes
6565
if params.Context != nil && params.Context.Diagnostics != nil {
6666
for _, diag := range params.Context.Diagnostics {
67-
if diag.Code.Integer == nil {
67+
if diag.Code == nil || diag.Code.Integer == nil {
6868
continue
6969
}
7070

0 commit comments

Comments
 (0)