Commit c8d17099 by Qiang Xue

Fixes #3016.

parent 2a038a1b
......@@ -655,6 +655,9 @@ class DbManager extends Manager
*/
public function getRule($name)
{
if ($name === null) {
return null;
}
$query = new Query;
$query->select(['data'])->from($this->ruleTable)->where(['name' => $name]);
$row = $query->createCommand($this->db)->queryOne();
......
......@@ -628,11 +628,7 @@ class PhpManager extends Manager
*/
public function getRule($name)
{
if (!isset($this->_rules[$name])) {
return null;
}
return $this->_rules[$name];
return $name !== null && isset($this->_rules[$name]) ? $this->_rules[$name] : null;
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment