Skip to content

fix(gazelle): guard against nil proto config in loadConfig#148

Open
ctcjab wants to merge 1 commit into
bufbuild:mainfrom
ctcjab:fix-nil-proto-config
Open

fix(gazelle): guard against nil proto config in loadConfig#148
ctcjab wants to merge 1 commit into
bufbuild:mainfrom
ctcjab:fix-nil-proto-config

Conversation

@ctcjab
Copy link
Copy Markdown

@ctcjab ctcjab commented May 25, 2026

Summary

proto.GetProtoConfig() returns nil when the proto Gazelle language is not loaded alongside buf. This causes a nil pointer dereference panic in loadConfig at gazelle/buf/config.go:117.

This can happen when using aspect_gazelle_prebuilt (or any Gazelle binary) with buf enabled but proto not in the languages list.

Fix

Guard the proto.GetProtoConfig() return value with a nil check. When nil, log a message and skip the strip_import_prefix configuration.

Fixes #147

proto.GetProtoConfig() returns nil when the proto Gazelle language
is not loaded alongside buf. Guard the return value to prevent a
nil pointer dereference panic.

Fixes bufbuild#147
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 25, 2026

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gazelle buf extension crashes with nil pointer dereference when proto language is not loaded

3 participants