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); }