﻿id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc
18491,Calling wp_get_attachment_link with a non-existent ID throws PHP notice,Jayjdk,ryan,"If you're are using the `wp_get_attachment_link()` function with a non-existent attachment ID, you'll get a notice.

Example:
`<?php echo wp_get_attachment_link( 9 ); ?>`

gives `Notice: Trying to get property of non-object in C:\wamp\www\theme\wp-includes\post-template.php on line 1155`


As far I can see, the code causing it is this (wp-includes\post-template.php on line 1155)

{{{
$_post = & get_post( $id );

if ( ('attachment' != $_post->post_type) || !$url = wp_get_attachment_url($_post->ID) )
	return __('Missing Attachment');
}}}

The $_post variable will be null in this case.",defect (bug),closed,normal,3.3,Warnings/Notices,,normal,fixed,has-patch,ehitter@…
