Skip to content

storage/url: add nil check for URL.filterRegex in URL.Match - #511

Merged
sonmezonur merged 2 commits into
peak:masterfrom
kucukaslan:nil-check
Sep 16, 2022
Merged

sonmezonur merged 2 commits into
peak:masterfrom
kucukaslan:nil-check

Conversation

@kucukaslan

Copy link
Copy Markdown
Contributor

URL.Match method assumes that URL.filterRegex is not nil and used it without check. But if the URL was created with raw option or was created with type literal then it might be nil. So if Match was called for such URLs then it panics.

ps. It occured in an old variants of autocompletion PR. But that part of the code was changed now, so we won't include this change there.

@kucukaslan
kucukaslan requested review from a team, aykutfarsak and igungor and removed request for a team September 13, 2022 11:43
@sonmezonur
sonmezonur self-requested a review September 16, 2022 12:01
@sonmezonur
sonmezonur merged commit 22592e5 into peak:master Sep 16, 2022
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.

3 participants