Skip to content

Commit a88be42

Browse files
authored
ts: Validate error.data exists on simulation response (solana-foundation#2508)
1 parent 65c9d6e commit a88be42

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • ts/packages/anchor/src/utils

ts/packages/anchor/src/utils/rpc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ export async function simulateTransaction(
195195
if ("error" in res) {
196196
let logs;
197197
if ("data" in res.error) {
198-
logs = res.error.data.logs;
198+
logs = res.error.data?.logs;
199199
if (logs && Array.isArray(logs)) {
200200
const traceIndent = "\n ";
201201
const logTrace = traceIndent + logs.join(traceIndent);

0 commit comments

Comments
 (0)