KeyChainGroup: Fix NullPointerException in findRedeemDataFromScriptHash() if no deterministic keychain is in the group.
@@ -502,6 +502,7 @@ public class KeyChainGroup implements KeyBag {
@Override
@Nullable
public RedeemData findRedeemDataFromScriptHash(byte[] scriptHash) {
+ if (chains != null) {
// Iterate in reverse order, since the active keychain is the one most likely to have the hit
for (Iterator<DeterministicKeyChain> iter = chains.descendingIterator(); iter.hasNext();) {
DeterministicKeyChain chain = iter.next();
@@ -509,6 +510,7 @@ public class KeyChainGroup implements KeyBag {
if (redeemData != null)
return redeemData;
}
+ }
return null;
}
