From f9485be59d94c0c058ab7ec651e8a8c384028a16 Mon Sep 17 00:00:00 2001 From: djmil Date: Tue, 5 Dec 2023 15:04:03 +0100 Subject: [PATCH] remove null values from board.map --- .../java/djmil/cordacheckers/api/GameProposalController.java | 1 - .../java/djmil/cordacheckers/cordaclient/CordaClient.java | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/src/main/java/djmil/cordacheckers/api/GameProposalController.java b/backend/src/main/java/djmil/cordacheckers/api/GameProposalController.java index 5f7b3f5..200069c 100644 --- a/backend/src/main/java/djmil/cordacheckers/api/GameProposalController.java +++ b/backend/src/main/java/djmil/cordacheckers/api/GameProposalController.java @@ -48,7 +48,6 @@ public class GameProposalController { final HoldingIdentity gpReceiver = holdingIdentityResolver.getByUsername(gpRequest.opponentName()); final Stone.Color gpReceiverColor = gpRequest.opponentColor(); - // GiteaIssue #4: Exception handling GameView gameStateView = cordaClient.gameProposalCreate( gpSender, gpReceiver, diff --git a/backend/src/main/java/djmil/cordacheckers/cordaclient/CordaClient.java b/backend/src/main/java/djmil/cordacheckers/cordaclient/CordaClient.java index 66af72a..dd59663 100644 --- a/backend/src/main/java/djmil/cordacheckers/cordaclient/CordaClient.java +++ b/backend/src/main/java/djmil/cordacheckers/cordaclient/CordaClient.java @@ -4,6 +4,7 @@ import static java.util.Objects.requireNonNull; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.UUID; import java.util.concurrent.TimeUnit; @@ -110,6 +111,9 @@ public class CordaClient { public GameView gameProposalCreate(HoldingIdentity issuer, HoldingIdentity acquier, Stone.Color acquierColor, Map board, String message) throws RspFailureException { + + board.values().removeIf(Objects::isNull); // '5=BLACK.MAN, 6=null, 7=BLACK.MAN, 8=null, 9=BLACK.MAN, 10=BLACK.MAN' + final RequestBody requestBody = new RequestBody( "gp.create-" + UUID.randomUUID(), "djmil.cordacheckers.gameproposal.CreateFlow",