Commit 831e5115 by Qiang Xue

proper check of "db" property of ActiveDataProvider.

parent 73442fb1
...@@ -86,9 +86,9 @@ class ActiveDataProvider extends BaseDataProvider ...@@ -86,9 +86,9 @@ class ActiveDataProvider extends BaseDataProvider
parent::init(); parent::init();
if (is_string($this->db)) { if (is_string($this->db)) {
$this->db = Yii::$app->getComponent($this->db); $this->db = Yii::$app->getComponent($this->db);
if (!$this->db instanceof Connection) {
throw new InvalidConfigException('The "db" property must be a valid DB Connection application component.');
} }
if ($this->db === null) {
throw new InvalidConfigException('The "db" property must be a valid DB Connection application component.');
} }
} }
......
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