aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--background_scripts/exclusions.coffee6
1 files changed, 5 insertions, 1 deletions
diff --git a/background_scripts/exclusions.coffee b/background_scripts/exclusions.coffee
index 3a8ef1e7..cf7fbbb3 100644
--- a/background_scripts/exclusions.coffee
+++ b/background_scripts/exclusions.coffee
@@ -6,7 +6,11 @@ RegexpCache =
if regexp = @cache[pattern]
regexp
else
- @cache[pattern] = new RegExp("^" + pattern.replace(/\*/g, ".*") + "$")
+ @cache[pattern] =
+ try
+ new RegExp("^" + pattern.replace(/\*/g, ".*") + "$")
+ catch
+ /^$/ # Match the empty string.
# The Exclusions class manages the exclusion rule setting.
# An exclusion is an object with two attributes: pattern and passKeys.