Fix PHP 7.2 incompatibility

This commit is contained in:
Alain Schlesser 2018-09-25 19:02:51 +02:00
parent d51a18884a
commit 3dc04e4e8a

View file

@ -61,7 +61,7 @@ class Logger {
if ( ! is_null( $this->start_time ) ) {
$this->time += microtime( true ) - $this->start_time;
}
if ( ! is_null( $this->query_offset ) && isset( $wpdb ) ) {
if ( ! is_null( $this->query_offset ) && isset( $wpdb ) && ! empty( $wpdb->queries ) ) {
for ( $i = $this->query_offset; $i < count( $wpdb->queries ); $i++ ) {
$this->query_time += $wpdb->queries[ $i ][1];
$this->query_count++;