Skip to content

Commit f34264c

Browse files
committed
Explicitly ensure the rows property is populated even if no queries are processed after filtering out admin bar queries.
1 parent 6384fa2 commit f34264c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

collectors/db_queries.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ public function process_db_object() {
117117
return;
118118
}
119119

120+
$this->data->rows = array();
121+
120122
$types = array();
121123
$total_time = 0;
122124
$has_result = false;
@@ -236,7 +238,7 @@ public function process_db_object() {
236238
'is_main_query' => true,
237239
) );
238240

239-
$this->data->total_qs = count( (array) $this->data->rows );
241+
$this->data->total_qs = count( $this->data->rows );
240242
$this->data->total_time = $total_time;
241243
$this->data->has_result = $has_result;
242244
$this->data->has_trace = $has_trace;

0 commit comments

Comments
 (0)