From e7b6cd83c7e3b5efff45c21d963c62b8828b4c7c Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Sat, 13 Mar 2010 07:47:20 +0000 Subject: [PATCH] Prevent PHP Notices on 404 pages git-svn-id: https://develop.svn.wordpress.org/trunk@13691 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/query.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/query.php b/wp-includes/query.php index e47a8db21d..c043904555 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -2665,7 +2665,7 @@ class WP_Query { } elseif ( $this->is_posts_page ) { $this->queried_object = & get_page(get_option('page_for_posts')); $this->queried_object_id = (int) $this->queried_object->ID; - } elseif ( $this->is_single ) { + } elseif ( $this->is_single && !is_null($this->post) ) { $this->queried_object = $this->post; $this->queried_object_id = (int) $this->post->ID; } elseif ( $this->is_page && !is_null($this->post) ) {