From 7744bffea45861e6f83b5a85641cd69a1919366c Mon Sep 17 00:00:00 2001 From: brave-builds Date: Mon, 13 Jan 2025 18:55:50 +0000 Subject: [PATCH] Uplift of #27204 (squashed) to beta --- .../chrome/browser/crypto_wallet/util/WalletUtils.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/android/java/org/chromium/chrome/browser/crypto_wallet/util/WalletUtils.java b/android/java/org/chromium/chrome/browser/crypto_wallet/util/WalletUtils.java index 9ed9839dad75..941ff619abcc 100644 --- a/android/java/org/chromium/chrome/browser/crypto_wallet/util/WalletUtils.java +++ b/android/java/org/chromium/chrome/browser/crypto_wallet/util/WalletUtils.java @@ -85,7 +85,12 @@ public static boolean accountIdsEqual(AccountId left, AccountId right) { return left.uniqueKey.equals(right.uniqueKey); } - public static boolean accountIdsEqual(AccountInfo left, AccountInfo right) { + public static boolean accountIdsEqual(@Nullable AccountInfo left, @Nullable AccountInfo right) { + // Return false if either account is null since we can't compare null accounts + // This is a fix to avoid https://github.com/brave/brave-browser/issues/43261 + if (left == null || right == null) { + return false; + } return accountIdsEqual(left.accountId, right.accountId); }