1
0
Fork 0

Ignore null rules in rule generator

Fixes #806
pull/808/head
Nils Adermann 2012-06-17 20:14:58 +02:00
parent e953b4c891
commit dc2a9bfe62
1 changed files with 2 additions and 2 deletions

View File

@ -127,14 +127,14 @@ class RuleSetGenerator
* Adds a rule unless it duplicates an existing one of any type
*
* To be able to directly pass in the result of one of the rule creation
* methods.
* methods null is allowed which will not insert a rule.
*
* @param int $type A TYPE_* constant defining the rule type
* @param Rule $newRule The rule about to be added
*/
private function addRule($type, Rule $newRule = null)
{
if ($this->rules->containsEqual($newRule)) {
if (!$newRule || $this->rules->containsEqual($newRule)) {
return;
}