diff --git a/sdk/src/main/java/com/hedera/hashgraph/sdk/NodeUpdateTransaction.java b/sdk/src/main/java/com/hedera/hashgraph/sdk/NodeUpdateTransaction.java index 19312002f..de5a31575 100644 --- a/sdk/src/main/java/com/hedera/hashgraph/sdk/NodeUpdateTransaction.java +++ b/sdk/src/main/java/com/hedera/hashgraph/sdk/NodeUpdateTransaction.java @@ -454,7 +454,9 @@ void initFromTransactionBody() { accountId = AccountId.fromProtobuf(body.getAccountId()); } - description = body.getDescription().getValue(); + if (body.hasDescription()) { + description = body.getDescription().getValue(); + } for (var gossipEndpoint : body.getGossipEndpointList()) { gossipEndpoints.add(Endpoint.fromProtobuf(gossipEndpoint)); diff --git a/sdk/src/test/java/com/hedera/hashgraph/sdk/NodeUpdateTransactionTest.java b/sdk/src/test/java/com/hedera/hashgraph/sdk/NodeUpdateTransactionTest.java index 2d976e435..f56474b57 100644 --- a/sdk/src/test/java/com/hedera/hashgraph/sdk/NodeUpdateTransactionTest.java +++ b/sdk/src/test/java/com/hedera/hashgraph/sdk/NodeUpdateTransactionTest.java @@ -118,12 +118,13 @@ void shouldBytes() throws Exception { } @Test - void testNullCertificates() throws Exception { + void testNullOptionalValues() throws Exception { var tx = new NodeUpdateTransaction(); var tx2Bytes = tx.toBytes(); NodeUpdateTransaction deserializedTx = (NodeUpdateTransaction) Transaction.fromBytes(tx2Bytes); assertThat(deserializedTx.getGossipCaCertificate()).isNull(); assertThat(deserializedTx.getGrpcCertificateHash()).isNull(); + assertThat(deserializedTx.getDescription()).isNull(); } @Test