Possible exception fix

This commit is contained in:
Igor B. Poretsky 2017-09-06 04:22:37 +03:00
parent ec8390b923
commit 924c864ff6

View file

@ -1193,12 +1193,15 @@ public class MapControlsLayer extends OsmandMapLayer {
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) { public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
if (requestCode == REQUEST_LOCATION_FOR_NAVIGATION_PERMISSION if (requestCode == REQUEST_LOCATION_FOR_NAVIGATION_PERMISSION
&& grantResults.length > 0
&& grantResults[0] == PackageManager.PERMISSION_GRANTED) { && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
onNavigationClick(); onNavigationClick();
} else if (requestCode == REQUEST_LOCATION_FOR_NAVIGATION_FAB_PERMISSION } else if (requestCode == REQUEST_LOCATION_FOR_NAVIGATION_FAB_PERMISSION
&& grantResults.length > 0
&& grantResults[0] == PackageManager.PERMISSION_GRANTED) { && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
navigateFab(); navigateFab();
} else if (requestCode == REQUEST_LOCATION_FOR_ADD_DESTINATION_PERMISSION } else if (requestCode == REQUEST_LOCATION_FOR_ADD_DESTINATION_PERMISSION
&& grantResults.length > 0
&& grantResults[0] == PackageManager.PERMISSION_GRANTED) { && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
addDestination(requestedLatLon); addDestination(requestedLatLon);
} }