Unverified Commit 7bb6c30c authored by bunsenstraat's avatar bunsenstraat Committed by GitHub

Merge pull request #1350 from ethereum/debugcrash

fix debugger crash
parents 8a250941 159d508e
......@@ -5,6 +5,7 @@ import { ExtractData } from '../../types' // eslint-disable-line
export const SolidityState = ({ calldata, message }) => {
const formatSelf = (key: string, data: ExtractData) => {
try {
let color = 'var(--primary)'
if (data.isArray || data.isStruct || data.isMapping) {
color = 'var(--info)'
......@@ -31,6 +32,9 @@ export const SolidityState = ({ calldata, message }) => {
</label>
</label>
)
} catch (e) {
return (<></>)
}
}
return (
......
......@@ -4,9 +4,10 @@ import { ExtractData } from '../types' // eslint-disable-line
export function extractData (item, parent): ExtractData {
const ret: ExtractData = {}
if (item.isProperty) {
if (item.isProperty || !item.type) {
return item
}
try {
if (item.type.lastIndexOf(']') === item.type.length - 1) {
ret.children = (item.value || []).map(function (item, index) {
return { key: index, value: item }
......@@ -40,5 +41,8 @@ export function extractData (item, parent): ExtractData {
ret.self = item.value
ret.type = item.type
}
} catch (e) {
console.log(e)
}
return ret
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment