Index: wp-includes/post-template.php
===================================================================
--- wp-includes/post-template.php	(revision 28585)
+++ wp-includes/post-template.php	(working copy)
@@ -23,10 +23,11 @@
  * @since 2.1.0
  * @uses $post
  *
- * @return int
+ * @return int the ID of the current item
  */
 function get_the_ID() {
-	return get_post()->ID;
+	$post = get_post();
+	return !empty ( $post ) ? $post->ID : false ;
 }
 
 /**
