if statement for featured images

The second if statement requires it to be a post, so a 404 page won’t pass.

I’d re-do it like this, using elseif statements. I also changed $thumbnail->ID to $post->ID since the former was not defined.

add_action( 'genesis_before_header', 'minimum_featured_image' );
function minimum_featured_image() {

    global $post; 

    if ( is_home() ) {
        echo '<div id="featured-image-home">';
        echo get_the_post_thumbnail($post->ID, 'header');
        echo '</div>';
    }
    elseif ( is_singular( array( 'post' , 'page' ) ) && ( !has_post_thumbnail( $post->ID ) ) ){
        echo '<div id="featured-image">';
        echo get_the_post_thumbnail($post->ID, 'header');
        echo '</div>';
    }   
    elseif(is_singular( array( 'post' , 'page' ) ){
        echo '<div id="featured-image-home"><img src="'. get_stylesheet_directory_uri() . '/images/blog-banner.jpg" /></div>';
    }
}