mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-02-23 22:46:56 +01:00
Fixing NPE in ExamplePaymentChannelServer due to using unintialized state.
This commit is contained in:
parent
36ba209a24
commit
caa294c7f6
1 changed files with 2 additions and 1 deletions
|
@ -42,7 +42,6 @@ import java.util.List;
|
|||
public class ExamplePaymentChannelServer implements PaymentChannelServerListener.HandlerFactory {
|
||||
private static final org.slf4j.Logger log = LoggerFactory.getLogger(ExamplePaymentChannelServer.class);
|
||||
|
||||
private StoredPaymentChannelServerStates storedStates;
|
||||
private WalletAppKit appKit;
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
|
@ -88,6 +87,8 @@ public class ExamplePaymentChannelServer implements PaymentChannelServerListener
|
|||
// Try to get the state object from the stored state set in our wallet
|
||||
PaymentChannelServerState state = null;
|
||||
try {
|
||||
StoredPaymentChannelServerStates storedStates = (StoredPaymentChannelServerStates)
|
||||
appKit.wallet().getExtensions().get(StoredPaymentChannelServerStates.class.getName());
|
||||
state = storedStates.getChannel(channelId).getOrCreateState(appKit.wallet(), appKit.peerGroup());
|
||||
} catch (VerificationException e) {
|
||||
// This indicates corrupted data, and since the channel was just opened, cannot happen
|
||||
|
|
Loading…
Add table
Reference in a new issue