Fix nullpointer

Log used message (not set string here) instead of
PrivateNotificationPayload message.
This commit is contained in:
Manfred Karrer 2018-06-27 21:45:15 +02:00
parent aecbb71620
commit 2d5688a9a3
No known key found for this signature in database
GPG Key ID: 401250966A6B2C46

View File

@ -131,32 +131,31 @@ public class SendPrivateNotificationWindow extends Overlay<SendPrivateNotificati
Button sendButton = new AutoTooltipButton(Res.get("sendPrivateNotificationWindow.send"));
sendButton.setOnAction(e -> {
if (alertMessageTextArea.getText().length() > 0 && keyInputTextField.getText().length() > 0) {
PrivateNotificationPayload privateNotification = new PrivateNotificationPayload(alertMessageTextArea.getText());
if (!sendPrivateNotificationHandler.handle(
new PrivateNotificationPayload(alertMessageTextArea.getText()),
privateNotification,
pubKeyRing,
nodeAddress,
keyInputTextField.getText(),
new SendMailboxMessageListener() {
@Override
public void onArrived() {
log.info("{} arrived at peer {}.",
message.getClass().getSimpleName(), nodeAddress);
log.info("PrivateNotificationPayload arrived at peer {}.", nodeAddress);
new Popup<>().feedback(Res.get("shared.messageArrived"))
.onClose(SendPrivateNotificationWindow.this::hide).show();
}
@Override
public void onStoredInMailbox() {
log.info("{} stored in mailbox for peer {}.",
message.getClass().getSimpleName(), nodeAddress);
log.info("PrivateNotificationPayload stored in mailbox for peer {}.", nodeAddress);
new Popup<>().feedback(Res.get("shared.messageStoredInMailbox"))
.onClose(SendPrivateNotificationWindow.this::hide).show();
}
@Override
public void onFault(String errorMessage) {
log.error("{} failed: Peer {}, errorMessage={}",
message.getClass().getSimpleName(), nodeAddress, errorMessage);
log.error("PrivateNotificationPayload failed: Peer {}, errorMessage={}", nodeAddress,
errorMessage);
new Popup<>().feedback(Res.get("shared.messageSendingFailed", errorMessage))
.onClose(SendPrivateNotificationWindow.this::hide).show();
}