From b150d08188c5a43f8b7ec8798897d9225b730324 Mon Sep 17 00:00:00 2001 From: Christian Basler Date: Tue, 23 Jun 2015 22:29:44 +0200 Subject: [PATCH] Fixed NPE --- .../main/java/ch/dissem/bitmessage/DefaultMessageListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/domain/src/main/java/ch/dissem/bitmessage/DefaultMessageListener.java b/domain/src/main/java/ch/dissem/bitmessage/DefaultMessageListener.java index b521464..105cc96 100644 --- a/domain/src/main/java/ch/dissem/bitmessage/DefaultMessageListener.java +++ b/domain/src/main/java/ch/dissem/bitmessage/DefaultMessageListener.java @@ -91,6 +91,7 @@ class DefaultMessageListener implements NetworkHandler.MessageListener { if (address != null) { address.setPubkey(pubkey); LOG.debug("Got pubkey for contact " + address); + ctx.getAddressRepo().save(address); List messages = ctx.getMessageRepository().findMessages(Plaintext.Status.PUBKEY_REQUESTED, address); LOG.debug("Sending " + messages.size() + " messages for contact " + address); for (Plaintext msg : messages) { @@ -107,7 +108,6 @@ class DefaultMessageListener implements NetworkHandler.MessageListener { msg.setStatus(SENT); ctx.getMessageRepository().save(msg); } - ctx.getAddressRepo().save(address); } } catch (DecryptionFailedException ignore) { }