diff --git a/src/providers/tenderly-simulation-provider.ts b/src/providers/tenderly-simulation-provider.ts index 71af10dd0..3e34790ff 100644 --- a/src/providers/tenderly-simulation-provider.ts +++ b/src/providers/tenderly-simulation-provider.ts @@ -466,7 +466,13 @@ export class TenderlySimulator extends Simulator { )}.` ); - if ((resp.result[2] as JsonRpcError).error.data) { + if ( + resp && + resp.result && + resp.result.length >= 3 && + (resp.result[2] as JsonRpcError).error && + (resp.result[2] as JsonRpcError).error.data + ) { return { ...swapRoute, simulationStatus: breakDownTenderlySimulationError(