Skip to content

Commit

Permalink
Fix #805 - Check property exists before using it (#806)
Browse files Browse the repository at this point in the history
Co-authored-by: Shiv Bhonde <shivbhonde04@gmail.com>
  • Loading branch information
dragonsisdumb and technophile-04 committed Apr 16, 2024
1 parent c55d258 commit 3a5b515
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,14 @@ function getArtifactOfContract(contractName) {

function getInheritedFromContracts(artifact) {
let inheritedFromContracts = [];
for (const astNode of artifact.ast.nodes) {
if (astNode.nodeType == "ContractDefinition") {
if (astNode.baseContracts.length > 0) {
inheritedFromContracts = astNode.baseContracts.map(
({ baseName }) => baseName.name
);
if (artifact?.ast) {
for (const astNode of artifact.ast.nodes) {
if (astNode.nodeType == "ContractDefinition") {
if (astNode.baseContracts.length > 0) {
inheritedFromContracts = astNode.baseContracts.map(
({ baseName }) => baseName.name
);
}
}
}
}
Expand Down

0 comments on commit 3a5b515

Please sign in to comment.