diff --git a/lib/rake/task_manager.rb b/lib/rake/task_manager.rb index b62edc8e3..7844f9ed9 100644 --- a/lib/rake/task_manager.rb +++ b/lib/rake/task_manager.rb @@ -126,7 +126,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, args, extensions, block, level) return task if task end