title: Try catch can't catch error
body: <p>I have website with masonry blog. I use Masonry js plugin (<a href="http://masonry.desandro.com/" rel="nofollow noreferrer">http://masonry.desandro.com/</a>).</p>
  
  <p>But if page doesn't have blog ( for example about page ) I get js error in console: </p>
  
  <pre><code>Bad masonry element: null
  </code></pre>
  
  <p>I try to use "try catch"</p>
  
  <pre><code>(function($){
  
      "use strict";
  
      $(document).ready(function(){
  
          try {
              var container = document.querySelector('#masonry');
              var msnry = new Masonry( container, {
                  itemSelector: '.post-item'
              });
          } catch(err) {
  
          }
  
      });
  
  })(window.jQuery);
  </code></pre>
  
  <p>But I still get this error</p>