Skip to content

Commit

Permalink
Merge pull request #230 from stellar/fix_nil_operationtracecode
Browse files Browse the repository at this point in the history
Add case for null operationResultTr for operation_trace_code
  • Loading branch information
sydneynotthecity authored Mar 7, 2024
2 parents c100c9d + aa830ed commit 1745e6e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions internal/transform/operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit 1745e6e

Please sign in to comment.