From 3dc04e4e8abe870e2f5abf8f31f3dc73cdca1e94 Mon Sep 17 00:00:00 2001 From: Alain Schlesser Date: Tue, 25 Sep 2018 19:02:51 +0200 Subject: [PATCH] Fix PHP 7.2 incompatibility --- inc/class-logger.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/class-logger.php b/inc/class-logger.php index 7206d2a..040ee0f 100644 --- a/inc/class-logger.php +++ b/inc/class-logger.php @@ -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++;