Index: wp-includes/post.php
===================================================================
--- wp-includes/post.php	(revision 5848)
+++ wp-includes/post.php	(working copy)
@@ -1183,7 +1183,6 @@
 	$query .= " ORDER BY " . $sort_column . " " . $sort_order ;
 
 	$pages = $wpdb->get_results($query);
-	$pages = apply_filters('get_pages', $pages, $r);
 
 	if ( empty($pages) )
 		return array();
@@ -1197,6 +1196,8 @@
 	$cache[ $key ] = $pages;
 	wp_cache_set( 'get_pages', $cache, 'page' );
 
+	$pages = apply_filters('get_pages', $pages, $r);
+
 	return $pages;
 }
 
@@ -1878,4 +1879,4 @@
 	}
 }
 
-?>
\ No newline at end of file
+?>
