handle undefined data

pull/1701/head^2
yann300 3 years ago
parent 71e56dfa69
commit e7455a8bb1
  1. 1
      libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx

@ -204,6 +204,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
const _setCompilerVersionFromPragma = (filename: string) => {
if (!state.allversions) return
api.readFile(filename).then(data => {
if (!data) return
const pragmaArr = data.match(/(pragma solidity (.+?);)/g)
if (pragmaArr && pragmaArr.length === 1) {
const pragmaStr = pragmaArr[0].replace('pragma solidity', '').trim()

Loading…
Cancel
Save