From 75179459d1f2310b7d1c3fb41f0bd2364d468cfb Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 6 Dec 2024 15:48:06 +0100 Subject: [PATCH] Prevent NPE --- app/src/main/java/eu/faircode/email/FragmentPop.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentPop.java b/app/src/main/java/eu/faircode/email/FragmentPop.java index 6c6e3896d4..34f05a93d4 100644 --- a/app/src/main/java/eu/faircode/email/FragmentPop.java +++ b/app/src/main/java/eu/faircode/email/FragmentPop.java @@ -423,7 +423,17 @@ public class FragmentPop extends FragmentBase { // Workaround odd focus issue if (scroll != null) - scroll.requestChildFocus(null, null); + try { + scroll.requestChildFocus(null, null); + } catch (Throwable ex) { + /* + java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.view.View.getRevealOnFocusHint()' on a null object reference + at android.widget.ScrollView.requestChildFocus(ScrollView.java:1471) + at eu.faircode.email.FragmentPop.onViewCreated(SourceFile:9) + at androidx.fragment.app.Fragment.performViewCreated(SourceFile:15) + */ + Log.w(ex); + } } private void onSave(boolean should) {