diff --git a/src/solidity/types/Enum.js b/src/solidity/types/Enum.js index 81873eee01..9687466bbc 100644 --- a/src/solidity/types/Enum.js +++ b/src/solidity/types/Enum.js @@ -16,7 +16,11 @@ function Enum (enumDef) { Enum.prototype.decodeFromStorage = function (location, storageContent) { var value = util.extractHexByte(location, storageContent, this.storageBytes) value = parseInt(value) - return this.enumDef.children[value].attributes.name + if (this.enumDef.children.length > value) { + return this.enumDef.children[value].attributes.name + } else { + return 'INVALID_ENUM<' + value + '>' + } } module.exports = Enum