Commit e41485e2 authored by salvis's avatar salvis

Issue #2951821 by salvis, Chi, rajeshwari10: Fix warning: count(): Parameter must be an array.

parent eb934b23
......@@ -41,11 +41,11 @@ class FormsDataCollector extends DataCollector implements DrupalDataCollectorInt
* @return array
*/
public function getForms() {
return $this->data['forms'];
return (!empty($this->data['forms']) && is_array($this->data['forms'])) ? $this->data['forms'] : [];
}
/**
* @return array
* @return int
*/
public function getFormsCount() {
return count($this->getForms());
......
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