From aa830edffd54d1ad9194490d492beaa839eff352 Mon Sep 17 00:00:00 2001 From: Simon Chow Date: Wed, 6 Mar 2024 22:11:16 -0500 Subject: [PATCH] Add case for null operationResultTr for operation_trace_code --- internal/transform/operation.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/internal/transform/operation.go b/internal/transform/operation.go index 5fe3e8af..5a6d1463 100644 --- a/internal/transform/operation.go +++ b/internal/transform/operation.go @@ -70,10 +70,15 @@ func TransformOperation(operation xdr.Operation, operationIndex int32, transacti if !ok { return OperationOutput{}, err } + outputOperationResultCode := outputOperationResults[operationIndex].Code.String() - outputOperationTraceCode, err := mapOperationTrace(*outputOperationResults[operationIndex].Tr) - if err != nil { - return OperationOutput{}, err + var outputOperationTraceCode string + operationResultTr, ok := outputOperationResults[operationIndex].GetTr() + if ok { + outputOperationTraceCode, err = mapOperationTrace(operationResultTr) + if err != nil { + return OperationOutput{}, err + } } transformedOperation := OperationOutput{