Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return early if magic source link URI has no path #3056

Merged

Conversation

vinistock
Copy link
Member

@vinistock vinistock commented Jan 13, 2025

Motivation

This error was caught by our telemetry. If someone is manually typing a magic source link or if there's some error in Tapioca's generation, then the URI's path might be nil, which then fails when we pass it to CGI.unescape with a no implicit conversion of nil to String.

Implementation

Started checking if there's a path before trying to unescape it.

Automated Tests

Added a test that fails in main.

@vinistock vinistock added bugfix This PR will fix an existing bug server This pull request should be included in the server gem's release notes labels Jan 13, 2025 — with Graphite App
Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@vinistock vinistock requested review from andyw8 and st0012 January 13, 2025 14:17
@vinistock vinistock marked this pull request as ready for review January 13, 2025 14:19
@vinistock vinistock requested a review from a team as a code owner January 13, 2025 14:19
@vinistock vinistock merged commit cf93a83 into main Jan 13, 2025
45 checks passed
@vinistock vinistock deleted the 01-13-return_early_if_magic_source_link_uri_has_no_path branch January 13, 2025 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This PR will fix an existing bug server This pull request should be included in the server gem's release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants