From 93b986bda751f727289acd421b35aa180a3dbb50 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 9 Apr 2024 09:40:27 +0200 Subject: [PATCH] fix checking var type --- .../debugger-ui/src/lib/vm-debugger/solidity-locals.tsx | 2 +- .../remix-ui/debugger-ui/src/lib/vm-debugger/solidity-state.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/remix-ui/debugger-ui/src/lib/vm-debugger/solidity-locals.tsx b/libs/remix-ui/debugger-ui/src/lib/vm-debugger/solidity-locals.tsx index 99aa7e8609..5ee7cb1954 100644 --- a/libs/remix-ui/debugger-ui/src/lib/vm-debugger/solidity-locals.tsx +++ b/libs/remix-ui/debugger-ui/src/lib/vm-debugger/solidity-locals.tsx @@ -14,7 +14,7 @@ export const SolidityLocals = ({data, message, registerEvent, triggerEvent, clas let color = 'var(--primary)' if (data.isArray || data.isStruct || data.isMapping) { color = 'var(--info)' - } else if (data.type.indexOf('uint') === 0 || data.type.indexOf('int') === 0 || data.type.indexOf('bool') === 0 || data.type.indexOf('enum') === 0) { + } else if (data.type && data.type.indexOf && (data.type.indexOf('uint') === 0 || data.type.indexOf('int') === 0 || data.type.indexOf('bool') === 0 || data.type.indexOf('enum') === 0)) { color = 'var(--green)' } else if (data.type === 'string') { color = 'var(--teal)' diff --git a/libs/remix-ui/debugger-ui/src/lib/vm-debugger/solidity-state.tsx b/libs/remix-ui/debugger-ui/src/lib/vm-debugger/solidity-state.tsx index 3448c40555..0032208953 100644 --- a/libs/remix-ui/debugger-ui/src/lib/vm-debugger/solidity-state.tsx +++ b/libs/remix-ui/debugger-ui/src/lib/vm-debugger/solidity-state.tsx @@ -9,7 +9,7 @@ export const SolidityState = ({calldata, message, className}) => { let color = 'var(--primary)' if (data.isArray || data.isStruct || data.isMapping) { color = 'var(--info)' - } else if (data.type.indexOf('uint') === 0 || data.type.indexOf('int') === 0 || data.type.indexOf('bool') === 0 || data.type.indexOf('enum') === 0) { + } else if (data.type && data.type.indexOf && (data.type.indexOf('uint') === 0 || data.type.indexOf('int') === 0 || data.type.indexOf('bool') === 0 || data.type.indexOf('enum') === 0)) { color = 'var(--green)' } else if (data.type === 'string') { color = 'var(--teal)'