From 2ffd39fc7fea60d4e3453f5b115e1d21df4aa3c5 Mon Sep 17 00:00:00 2001 From: Artem Samoilenko Date: Wed, 13 Nov 2024 08:10:01 -0500 Subject: [PATCH] [Android] Fix for edge case crash on brave news settings --- .../browser/settings/BraveNewsPreferencesTypeAdapter.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/android/java/org/chromium/chrome/browser/settings/BraveNewsPreferencesTypeAdapter.java b/android/java/org/chromium/chrome/browser/settings/BraveNewsPreferencesTypeAdapter.java index 00c10e371e96..240d7229e4eb 100644 --- a/android/java/org/chromium/chrome/browser/settings/BraveNewsPreferencesTypeAdapter.java +++ b/android/java/org/chromium/chrome/browser/settings/BraveNewsPreferencesTypeAdapter.java @@ -72,6 +72,8 @@ public BraveNewsPreferencesTypeAdapter( mBraveNewsPreferencesType = braveNewsPreferencesType; mPublisherList = publisherList; mChannelList = channelList; + // Init channel list as an empty array if it is null to avoid null pointer crashes. + if (mChannelList == null) mChannelList = new ArrayList<>(); if (mChannelList.size() > 0) { mChannelIcons = BraveNewsUtils.getChannelIcons(); }