Hide links to pages that dont have any content

I think you would need to implode(‘,’,$excluded_pages) for things to work,

$excluded_pages = array();
$all_pages = get_pages();
foreach ( $all_pages as $the_page ) {
    if ( '' == $the_page->post_content ) {
        $excluded_pages[] = $the_page->ID;
    }
}
wp_list_pages( array(
    'exclude' => implode(',',$excluded_pages)
) );

EDIT