From c7d88d843bfacdfb5f1f42d0f14968d29f3c3b13 Mon Sep 17 00:00:00 2001 From: Jonathan Bossenger Date: Fri, 25 May 2018 15:48:46 +0200 Subject: [PATCH] Fixed an error on the stats page If the post id does not exist, continue through the loop --- includes/class-ssp-stats.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/includes/class-ssp-stats.php b/includes/class-ssp-stats.php index c980dab..12ee445 100755 --- a/includes/class-ssp-stats.php +++ b/includes/class-ssp-stats.php @@ -762,6 +762,10 @@ public function stats_page () { $post = get_post( intval( $result->post_id ) ); + if ( ! $post ) { + continue; + } + $sql = "SELECT `date` FROM $this->_table WHERE `post_id` = '".$result->post_id."'"; $episode_results = $wpdb->get_results( $sql );