Index: post.php
===================================================================
--- post.php	(revision 18728)
+++ post.php	(working copy)
@@ -168,13 +168,15 @@
  *
  * @param int $attachment_id Attachment ID.
  * @param bool $unfiltered Whether to apply filters.
- * @return string The file path to the attached file.
+ * @return string|bool The file path to the attached file, or false if the attachment does not exist.
  */
 function get_attached_file( $attachment_id, $unfiltered = false ) {
 	$file = get_post_meta( $attachment_id, '_wp_attached_file', true );
-	// If the file is relative, prepend upload dir
-	if ( 0 !== strpos($file, '/') && !preg_match('|^.:\\\|', $file) && ( ($uploads = wp_upload_dir()) && false === $uploads['error'] ) )
-		$file = $uploads['basedir'] . "/$file";
+	if ( ! empty ( $file ) ) {
+		// If the file is relative, prepend upload dir
+		if ( 0 !== strpos($file, '/') && !preg_match('|^.:\\\|', $file) && ( ($uploads = wp_upload_dir()) && false === $uploads['error'] ) )
+			$file = $uploads['basedir'] . "/$file";
+	}
 	if ( $unfiltered )
 		return $file;
 	return apply_filters( 'get_attached_file', $file, $attachment_id );
