mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +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
|
@Override
|
||||||
public void onPause() {
|
public void onPause() {
|
||||||
super.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();
|
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