How to make Feature Image required for a Particular Template

For a particular post, I use a specific template (Story template) to display it. And any post with this particular template should have Featured Image.

I am using this snippet code to check if the item to be published is a post or a page. I would want to include if the user selects the template (Story template), s/he would need to add a featured image else the post would not be published.