remove null values from board.map
This commit is contained in:
parent
4428fdd25f
commit
f9485be59d
@ -48,7 +48,6 @@ public class GameProposalController {
|
|||||||
final HoldingIdentity gpReceiver = holdingIdentityResolver.getByUsername(gpRequest.opponentName());
|
final HoldingIdentity gpReceiver = holdingIdentityResolver.getByUsername(gpRequest.opponentName());
|
||||||
final Stone.Color gpReceiverColor = gpRequest.opponentColor();
|
final Stone.Color gpReceiverColor = gpRequest.opponentColor();
|
||||||
|
|
||||||
// GiteaIssue #4: Exception handling
|
|
||||||
GameView gameStateView = cordaClient.gameProposalCreate(
|
GameView gameStateView = cordaClient.gameProposalCreate(
|
||||||
gpSender,
|
gpSender,
|
||||||
gpReceiver,
|
gpReceiver,
|
||||||
|
@ -4,6 +4,7 @@ import static java.util.Objects.requireNonNull;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
@ -110,6 +111,9 @@ public class CordaClient {
|
|||||||
|
|
||||||
public GameView gameProposalCreate(HoldingIdentity issuer, HoldingIdentity acquier, Stone.Color acquierColor,
|
public GameView gameProposalCreate(HoldingIdentity issuer, HoldingIdentity acquier, Stone.Color acquierColor,
|
||||||
Map<Integer, Stone> board, String message) throws RspFailureException {
|
Map<Integer, Stone> 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(
|
final RequestBody requestBody = new RequestBody(
|
||||||
"gp.create-" + UUID.randomUUID(),
|
"gp.create-" + UUID.randomUUID(),
|
||||||
"djmil.cordacheckers.gameproposal.CreateFlow",
|
"djmil.cordacheckers.gameproposal.CreateFlow",
|
||||||
|
Loading…
Reference in New Issue
Block a user