check property is set

pull/5370/head
yann300 2 years ago committed by GitHub
parent cf5c66dcc4
commit d674407d69
  1. 2
      apps/remix-ide/src/app/providers/injected-provider.tsx

@ -62,7 +62,7 @@ export class InjectedProvider extends Plugin implements IProvider {
try { try {
if ((window as any) && typeof (window as any).ethereum.request === "function") (window as any).ethereum.request({ method: "eth_requestAccounts" }); if ((window as any) && typeof (window as any).ethereum.request === "function") (window as any).ethereum.request({ method: "eth_requestAccounts" });
let resultData = await this.provider.currentProvider.send(data.method, data.params) let resultData = await this.provider.currentProvider.send(data.method, data.params)
if (resultData && resultData.jsonrpc === '2.0') { if (resultData && resultData.jsonrpc && resultData.jsonrpc === '2.0') {
resultData = resultData.result resultData = resultData.result
} }
resolve({ jsonrpc: '2.0', result: resultData, id: data.id }) resolve({ jsonrpc: '2.0', result: resultData, id: data.id })

Loading…
Cancel
Save