diff --git a/apps/remix-ide/src/app/providers/custom-vm-fork-provider.tsx b/apps/remix-ide/src/app/providers/custom-vm-fork-provider.tsx index 51caf86950..aa4cad5144 100644 --- a/apps/remix-ide/src/app/providers/custom-vm-fork-provider.tsx +++ b/apps/remix-ide/src/app/providers/custom-vm-fork-provider.tsx @@ -28,7 +28,7 @@ export class CustomForkVMProvider extends BasicVMProvider { async init () { const body = () => { return
- Please provide information about the custom fork: + Please provide information about the custom fork. If the node URL is not provided, the VM will start with an empty state.
@@ -54,7 +54,7 @@ export class CustomForkVMProvider extends BasicVMProvider { title: this.profile.displayName, message: body(), validationFn: (data: any) => { - if(!data.nodeUrl.startsWith("http")) { + if(data.nodeUrl !== '' && !data.nodeUrl.startsWith("http")) { return { valid: false, message: 'node URL should be a valid URL' @@ -89,8 +89,14 @@ export class CustomForkVMProvider extends BasicVMProvider { })() this.fork = result.evmType this.nodeUrl = result.nodeUrl - const block = result.blockNumber - this.blockNumber = block === 'latest' ? 'latest' : parseInt(block) + if (this.nodeUrl) { + const block = result.blockNumber + this.blockNumber = block === 'latest' ? 'latest' : parseInt(block) + } else { + this.nodeUrl = undefined + this.blockNumber = undefined + } + return { 'fork': this.fork, 'nodeUrl': this.nodeUrl,