diff --git a/sentry_sdk/utils.py b/sentry_sdk/utils.py index 0963015351..8a67ec1d77 100644 --- a/sentry_sdk/utils.py +++ b/sentry_sdk/utils.py @@ -1736,6 +1736,8 @@ def match_regex_list( return False for item_matcher in regex_list: + if item_matcher == "": + continue if not substring_matching and item_matcher[-1] != "$": item_matcher += "$" diff --git a/tests/test_utils.py b/tests/test_utils.py index 718cdbaa1d..5a67fe8429 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -551,6 +551,7 @@ def test_include_source_context_when_serializing_frame(include_source_context): ["some-string", [], False], ["some-string", None, False], ["some-string", ["some-string"], True], + ["some-string", [""], False], ["some-string", ["some"], False], ["some-string", ["some$"], False], # same as above ["some-string", ["some.*"], True],