Skip to content

fix(match_regex_list): handle empty string patterns without IndexError#6802

Open
hiro-nikaitou wants to merge 1 commit into
getsentry:masterfrom
hiro-nikaitou:fix/match-regex-list-empty-string
Open

fix(match_regex_list): handle empty string patterns without IndexError#6802
hiro-nikaitou wants to merge 1 commit into
getsentry:masterfrom
hiro-nikaitou:fix/match-regex-list-empty-string

Conversation

@hiro-nikaitou

Copy link
Copy Markdown

An empty string pattern in the regex list causes an IndexError: string index out of range when item_matcher[-1] is accessed. This is reachable through integrations like Celery (CeleryIntegration.exclude_beat_tasks) when users accidentally configure an empty pattern.

Skip empty string patterns in the loop to prevent the crash. A pattern with no characters is a no-op anyway.

Closes #6504

An empty string pattern in the regex list causes IndexError when
accessing item_matcher[-1]. Skip empty string patterns in the
loop to prevent the crash.

Closes getsentry#6504
@hiro-nikaitou hiro-nikaitou requested a review from a team as a code owner July 13, 2026 01:31
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.

match_regex_list raises IndexError when a pattern list contains an empty string

1 participant