Trying to get property of non-object error with thumbnail

I believe from your error that you are using this code inside the loop. You should be using the_post_thumbnail(). The code you are using is used outside the loop.

EDIT

It is always good practice to always first check if you have a thumbnail to display

So you should use

<?php if(has_post_thumbnail()): ?>
   <a href="https://wordpress.stackexchange.com/questions/142235/<?php the_permalink();?>">
      <?php the_post_thumbnail( 'thumbnail'); ?>
   </a>
<?php endif; ?>