Skip to content

Fix crash when invoking resolve_constant with an empty constant name#746

Open
vinistock wants to merge 1 commit intomainfrom
04-15-fix_crash_when_invoking_resolve_constant_with_an_empty_constant_name
Open

Fix crash when invoking resolve_constant with an empty constant name#746
vinistock wants to merge 1 commit intomainfrom
04-15-fix_crash_when_invoking_resolve_constant_with_an_empty_constant_name

Conversation

@vinistock
Copy link
Copy Markdown
Member

@vinistock vinistock commented Apr 16, 2026

We were crashing when invoking resolve_constant with an empty constant name or an incomplete name like Foo::. This PR ensures that we don't crash.

I considered raising an error instead of returning nil, but I talked myself out of doing so because then we'd essentially set the expectation that the API validates the fully qualified name. For example, "" would raise, but without extra changes #@@<Foo> would be accepted. Instead of trying to validate every possible input, I just went with nil.

Copy link
Copy Markdown
Member Author

vinistock commented Apr 16, 2026

@vinistock vinistock self-assigned this Apr 16, 2026
@vinistock vinistock added the bugfix A change that fixes an existing bug label Apr 16, 2026
@vinistock vinistock force-pushed the 04-15-fix_crash_when_invoking_resolve_constant_with_an_empty_constant_name branch from 7b3afb2 to b6d4a2f Compare April 16, 2026 14:53
@vinistock vinistock marked this pull request as ready for review April 16, 2026 14:54
@vinistock vinistock requested a review from a team as a code owner April 16, 2026 14:54
@vinistock vinistock force-pushed the 04-15-fix_crash_when_invoking_resolve_constant_with_an_empty_constant_name branch from b6d4a2f to e42b1ce Compare April 16, 2026 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix A change that fixes an existing bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant