This below if statement checks to see if there is a thumbnail in the post. If not, nothing will display.
<?php
if ( has_post_thumbnail() ) {
echo '<div class="oxy-post-image-fixed-ratio" style="background-image: url('.get_the_post_thumbnail_url().')"></div>';
}
?>