Skip to content

Commit

Permalink
Fix potential nil panic in LegacyTraceTransaction
Browse files Browse the repository at this point in the history
  • Loading branch information
omerfirmak committed Dec 1, 2023
1 parent 319375d commit c1e9e58
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rpc/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -1354,7 +1354,7 @@ func (h *Handler) TraceTransaction(ctx context.Context, hash felt.Felt) (json.Ra
// https://github.com/starkware-libs/starknet-specs/blob/1ae810e0137cc5d175ace4554892a4f43052be56/api/starknet_trace_api_openrpc.json#L11
func (h *Handler) LegacyTraceTransaction(ctx context.Context, hash felt.Felt) (json.RawMessage, *jsonrpc.Error) {
trace, err := h.traceTransaction(ctx, &hash, true)
if err.Code == ErrTxnHashNotFound.Code {
if err != nil && err.Code == ErrTxnHashNotFound.Code {
err = ErrInvalidTxHash
}
return trace, err
Expand Down

0 comments on commit c1e9e58

Please sign in to comment.