check data before slice

pull/5370/head
Oleksii Kosynskyi 1 year ago
parent 55ab40a2ee
commit 54f1e27a13
  1. 2
      libs/remix-lib/src/execution/txRunnerVM.ts
  2. 2
      libs/remix-lib/src/execution/txRunnerWeb3.ts

@ -56,7 +56,7 @@ export class TxRunnerVM {
execute (args: InternalTransaction, confirmationCb, gasEstimationForceSend, promptCb, callback: VMExecutionCallBack) { execute (args: InternalTransaction, confirmationCb, gasEstimationForceSend, promptCb, callback: VMExecutionCallBack) {
let data = args.data let data = args.data
if (data.slice(0, 2) !== '0x') { if (data && data.slice(0, 2) !== '0x') {
data = '0x' + data data = '0x' + data
} }

@ -82,7 +82,7 @@ export class TxRunnerWeb3 {
execute (args: InternalTransaction, confirmationCb, gasEstimationForceSend, promptCb, callback) { execute (args: InternalTransaction, confirmationCb, gasEstimationForceSend, promptCb, callback) {
let data = args.data let data = args.data
if (data.slice(0, 2) !== '0x') { if (data && data.slice(0, 2) !== '0x') {
data = '0x' + data data = '0x' + data
} }

Loading…
Cancel
Save