Skip to content

Commit

Permalink
ts: Validate error.data exists on simulation response (coral-xyz#2508)
Browse files Browse the repository at this point in the history
  • Loading branch information
rogaldh authored Jun 6, 2023
1 parent 65c9d6e commit a88be42
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ts/packages/anchor/src/utils/rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export async function simulateTransaction(
if ("error" in res) {
let logs;
if ("data" in res.error) {
logs = res.error.data.logs;
logs = res.error.data?.logs;
if (logs && Array.isArray(logs)) {
const traceIndent = "\n ";
const logTrace = traceIndent + logs.join(traceIndent);
Expand Down

0 comments on commit a88be42

Please sign in to comment.