Cleaned up code to prevent creation of a blank html file if the post ID is invalid, or if the root praw.reddit object cannot be created