package example.ark_smartbridge_listener.eth_transfer;

import org.springframework.stereotype.Service;

@Service
public class EthTransferContractViewMapper {

    public EthTransferContractView map(EthTransferContractEntity ethTransferContractEntity) {
        EthTransferContractView ethTransferContractView = new EthTransferContractView();

        ethTransferContractView.setToken(ethTransferContractEntity.getToken());
        ethTransferContractView.setCreatedAt(ethTransferContractEntity.getCreatedAt().toString());
        ethTransferContractView.setStatus(ethTransferContractEntity.getStatus());
        ethTransferContractView.setArkPerEthExchangeRate(ethTransferContractEntity.getArkPerEthExchangeRate().toPlainString());
        ethTransferContractView.setServiceArkAddress(ethTransferContractEntity.getServiceArkAddress());
        ethTransferContractView.setRequiredArkAmount(ethTransferContractEntity.getRequiredArkAmount().toPlainString());
        ethTransferContractView.setReturnArkAddress(ethTransferContractEntity.getReturnArkAddress());
        ethTransferContractView.setReturnArkAmount(ethTransferContractEntity.getReturnArkAmount().toPlainString());
        ethTransferContractView.setRecipientEthAddress(ethTransferContractEntity.getRecipientEthAddress());
        ethTransferContractView.setEthAmount(ethTransferContractEntity.getEthAmount().toPlainString());

        return ethTransferContractView;
    }
}

@@ -1043,32 +1043,106 @@
 nArkAddress());%0A
+        if (ethTransferContractEntity.getReturnArkAmount() != null) %7B%0A    
         ethTrans
@@ -1233,32 +1233,42 @@
 PlainString());%0A
+        %7D%0A
         ethTrans

fix null pointer exception