From 5735bca517a798a1ef6ffa87dc5882b69888cbdd Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sat, 1 Oct 2022 09:26:07 +0200 Subject: [PATCH] minor code clean up --- .../java/eu/siacs/conversations/persistance/FileBackend.java | 5 ++--- .../java/eu/siacs/conversations/ui/RtpSessionActivity.java | 3 +++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/persistance/FileBackend.java b/src/main/java/eu/siacs/conversations/persistance/FileBackend.java index 2d5496f2f..8519e5dbd 100644 --- a/src/main/java/eu/siacs/conversations/persistance/FileBackend.java +++ b/src/main/java/eu/siacs/conversations/persistance/FileBackend.java @@ -1602,7 +1602,6 @@ public class FileBackend { return getVideoDimensions(metadataRetriever); } - @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) private Dimensions getPdfDocumentDimensions(final File file) { final ParcelFileDescriptor fileDescriptor; try { @@ -1610,7 +1609,7 @@ public class FileBackend { if (fileDescriptor == null) { return new Dimensions(0, 0); } - } catch (FileNotFoundException e) { + } catch (final FileNotFoundException e) { return new Dimensions(0, 0); } try { @@ -1621,7 +1620,7 @@ public class FileBackend { page.close(); pdfRenderer.close(); return scalePdfDimensions(new Dimensions(height, width)); - } catch (IOException | SecurityException e) { + } catch (final IOException | SecurityException e) { Log.d(Config.LOGTAG, "unable to get dimensions for pdf document", e); return new Dimensions(0, 0); } diff --git a/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java b/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java index e73fdb23c..302fbf81d 100644 --- a/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/RtpSessionActivity.java @@ -521,6 +521,9 @@ public class RtpSessionActivity extends XmppActivity @StringRes int res; final String firstDenied = getFirstDenied(permissionResult.grantResults, permissionResult.permissions); + if (firstDenied == null) { + return; + } if (Manifest.permission.RECORD_AUDIO.equals(firstDenied)) { res = R.string.no_microphone_permission; } else if (Manifest.permission.CAMERA.equals(firstDenied)) {