Check for presence of $post object in $wp_query before referencing it

Conflicts:
	wpsc-components/theme-engine-v1/helpers/template.php