title: Address validation using Google Maps - Check Address
body: <p>I'm letting users add an address to their posts using Google Maps. </p>
  
  <p>If a user enters nothing for the map or enters odd special characters (#$!@#) it crashes the website and gives me this error: </p>
  
  <pre><code>var lat = data.results[0].geometry.location.lat;
                    ^
  TypeError: Cannot read property 'results' of undefined
  </code></pre>
  
  <p>I'm trying to figure out a way to check for this error when the form is submitted. So far I have had zero luck. Is it possible to check for this error? </p>
  
  <p>I've seen code like this but everything in undefined and I'm not sure how to define it in this case and frankly I'm not sure how the code below is operating. </p>
  
  <pre><code>  if (status == google.maps.GeocoderStatus.OK) {
          var lat = results[0].geometry.location.lat();
          var lon = results[0].geometry.location.lng();
          searchStores(lat, lon);
      } else {
          $addressErrorP.removeClass('hide');
      }
  </code></pre>
  
  <p>Thanks for any help!</p>