Skip to content

Commit

Permalink
fix: avoiding nullpointer if getFee returns null. (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kammerlo authored Apr 4, 2024
1 parent 37582c8 commit 84e6cff
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.cardanofoundation.rosetta.api.block.mapper;

import java.math.BigInteger;
import java.util.Optional;
import lombok.AllArgsConstructor;

import org.modelmapper.ModelMapper;
Expand Down Expand Up @@ -37,7 +39,7 @@ public BlockTx fromEntity(TxnEntity model) {

dest(ctx).setInputs(source(ctx).getInputKeys().stream().map(Utxo::fromUtxoKey).toList());
dest(ctx).setOutputs(source(ctx).getOutputKeys().stream().map(Utxo::fromUtxoKey).toList());
dest(ctx).setFee(source(ctx).getFee().toString());
dest(ctx).setFee(Optional.ofNullable(source(ctx).getFee()).map(BigInteger::toString).orElse(null));

return dest(ctx);

Expand Down

0 comments on commit 84e6cff

Please sign in to comment.