diff --git a/lib/rake/task_manager.rb b/lib/rake/task_manager.rb index 8bc7d42a4..f928309ed 100644 --- a/lib/rake/task_manager.rb +++ b/lib/rake/task_manager.rb @@ -127,7 +127,7 @@ def enhance_with_matching_rule(task_name, level=0) fail Rake::RuleRecursionOverflowError, "Rule Recursion Too Deep" if level >= 16 @rules.each do |pattern, args, extensions, block| - if pattern.match(task_name) + if pattern && pattern.match(task_name) task = attempt_rule(task_name, pattern, args, extensions, block, level) return task if task end