Skip to content

Commit 53b7d00

Browse files
milos1290Enuviel
authored andcommitted
Merge pull request #28 from Leanplum/feature/fix-permissions-exception
fix(permission): fix runtime exception if location permission is not …
1 parent 79976d7 commit 53b7d00

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

AndroidSDK/src/com/leanplum/LocationManagerImplementation.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,11 @@ private void startLocationClient() {
241241

242242
private boolean isPermissionGranted() {
243243
Context context = Leanplum.getContext();
244-
return context.checkCallingOrSelfPermission(PERMISSION) == PackageManager.PERMISSION_GRANTED;
244+
try {
245+
return context.checkCallingOrSelfPermission(PERMISSION) == PackageManager.PERMISSION_GRANTED;
246+
} catch (RuntimeException ignored) {
247+
return false;
248+
}
245249
}
246250

247251
private boolean isMetaDataSet() {

0 commit comments

Comments
 (0)