fix potential npe on transaction entry tooltip
What changed, and why it matters
This is a small bug-fix patch that prevents a crash (NullPointerException) when displaying a tooltip on a wallet transaction entry. The tooltip shows estimated confirmation time based on current network fee conditions. If a transaction had no fee rate data, the old code would crash while trying to use that missing value. The fix checks for the missing value and safely returns nothing instead. There is no indication this can be exploited by an attacker to steal funds or compromise the wallet.
No security action required beyond normal review and release. This is a routine stability fix.
Security signals we found
NullPointerException prevented by null guard
UI-only code path (transaction tooltip)
No input from untrusted network sources in changed code
No cryptographic, signing, or authentication logic touched
Evidence from the diff
TransactionEntry.getVSizeFromTip() previously assigned blockTransaction.getFeeRate() (a Double) directly to a primitive double, causing an unboxing NullPointerException when getFeeRate() returned null. The patch stores the result in a Double reference, null-checks it, and returns null early if absent. This affects only the tooltip/confirmation-time estimation UI path and is a local, defensive null check.
Changed components
src/main/java/com/sparrowwallet/sparrow/wallet/TransactionEntry.javaTransaction entry tooltip / confirmation time estimationInspect captured patch +4 / −1
diff --git a/src/main/java/com/sparrowwallet/sparrow/wallet/TransactionEntry.java b/src/main/java/com/sparrowwallet/sparrow/wallet/TransactionEntry.java
index c94a0fe..e68d6a9 100644
--- a/src/main/java/com/sparrowwallet/sparrow/wallet/TransactionEntry.java
+++ b/src/main/java/com/sparrowwallet/sparrow/wallet/TransactionEntry.java
@@ -245,8 +245,11 @@ public class TransactionEntry extends Entry implements Comparable<TransactionEnt
public Long getVSizeFromTip() {
if(!AppServices.getMempoolHistogram().isEmpty()) {
+ Double feeRate = blockTransaction.getFeeRate();
+ if(feeRate == null) {
+ return null;
+ }
Set<MempoolRateSize> rateSizes = AppServices.getMempoolHistogram().get(AppServices.getMempoolHistogram().lastKey());
- double feeRate = blockTransaction.getFeeRate();
return rateSizes.stream().filter(rateSize -> rateSize.getFee() > feeRate).mapToLong(MempoolRateSize::getVSize).sum();
}
Why this scored 16/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.