mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Catch NullPointerException when unregistering locationManager
This commit is contained in:
parent
8bf9808cfc
commit
6adf78bec9
1 changed files with 6 additions and 2 deletions
|
|
@ -307,9 +307,13 @@ public class ShareActivity
|
|||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M || ContextCompat.checkSelfPermission(this,
|
||||
Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
|
||||
|
||||
try {
|
||||
imageObj.unregisterLocationManager();
|
||||
Log.d(TAG, "Unregistered locationManager");
|
||||
}
|
||||
catch (NullPointerException e) {
|
||||
Log.d(TAG, "locationManager does not exist, not unregistered");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue