title: Try Catch within Button Logic
body: <p>I wrote some code that sets a marker on a current location when clicked. Unfortunately, the entire application crashes when no current location is given and the button is clicked. The error states: 
  java.lang.NullPointerException: Attempt to invoke virtual method 'double java.lang.Double.doubleValue()' on a null object reference</p>
  
  <p>Is there a way implement a try catch exemption within the button?</p>
  
  <p>Here is the on click instruction for the button:</p>
  
  <pre><code>    markerBtn.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View view) {
  
  
              LatLng myCurrentLocation = new LatLng(myCurrentLatitude, myCurrentLongitude);
              marker = mMap.addMarker(new MarkerOptions().position(myLocation).title("New Marker"));
              markerBtn.setTag("yo");
  
          }
      });
  </code></pre>