diff --git a/android/java/org/chromium/chrome/browser/settings/BraveMainPreferencesBase.java b/android/java/org/chromium/chrome/browser/settings/BraveMainPreferencesBase.java index 4283b7011cf3..ef3300ab3bfd 100644 --- a/android/java/org/chromium/chrome/browser/settings/BraveMainPreferencesBase.java +++ b/android/java/org/chromium/chrome/browser/settings/BraveMainPreferencesBase.java @@ -144,17 +144,19 @@ private void showNotificationWarningDialog() { private void notificationClick() { Preference notifications = findPreference(PREF_NOTIFICATIONS); - notifications.setOnPreferenceClickListener(preference -> { - mNotificationClicked = true; - - Intent intent = new Intent(); - intent.setAction(Settings.ACTION_APP_NOTIFICATION_SETTINGS); - intent.putExtra(Settings.EXTRA_APP_PACKAGE, - ContextUtils.getApplicationContext().getPackageName()); - startActivity(intent); - // We handle the click so the default action isn't triggered. - return true; - }); + if (notifications != null) { + notifications.setOnPreferenceClickListener(preference -> { + mNotificationClicked = true; + + Intent intent = new Intent(); + intent.setAction(Settings.ACTION_APP_NOTIFICATION_SETTINGS); + intent.putExtra(Settings.EXTRA_APP_PACKAGE, + ContextUtils.getApplicationContext().getPackageName()); + startActivity(intent); + // We handle the click so the default action isn't triggered. + return true; + }); + } } private void updateBravePreferences() {