NPE when choosing notification sound
- Android version: not provided
- Phone model: not provided
- Briar version: 1.4.5 (4df523aa)
Stacktrace:
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference
at org.briarproject.briar.android.settings.NotificationsFragment.onNotificationSoundClicked(NotificationsFragment.java:218)
at org.briarproject.briar.android.settings.NotificationsFragment.lambda$onCreatePreferences$0(NotificationsFragment.java:108)
at org.briarproject.briar.android.settings.NotificationsFragment.$r8$lambda$tuVFVxovM6wElFyU0NWBFxLNE14(NotificationsFragment.java)
at org.briarproject.briar.android.settings.NotificationsFragment$$ExternalSyntheticLambda6.onPreferenceClick(Unknown Source)
at androidx.preference.Preference.performClick(Preference.java:1184)
at androidx.preference.Preference.performClick(Preference.java:1166)
at androidx.preference.Preference$1.onClick(Preference.java:181)
at android.view.View.performClick(View.java:5265)
at android.view.View$PerformClick.run(View.java:21534)
at android.os.Handler.handleCallback(Handler.java:815)
at android.os.Handler.dispatchMessage(Handler.java:104)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:5765)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)
Looks like the UI assumes the value of the notifySound
LiveData will have been set, but it's not set until the settings have been loaded.
I thought we used to disable the UI until the settings were loaded, to avoid bugs like this. Maybe that was lost when we restructured the settings UI?