Skip to content

Commit 7b401f1

Browse files
Merge branch 'cli' into backmerge-wagmiv2
2 parents 5541563 + 3a5b515 commit 7b401f1

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

templates/extensions/foundry/packages/foundry/script/generateTsAbis.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,14 @@ function getArtifactOfContract(contractName) {
3636

3737
function getInheritedFromContracts(artifact) {
3838
let inheritedFromContracts = [];
39-
for (const astNode of artifact.ast.nodes) {
40-
if (astNode.nodeType == "ContractDefinition") {
41-
if (astNode.baseContracts.length > 0) {
42-
inheritedFromContracts = astNode.baseContracts.map(
43-
({ baseName }) => baseName.name
44-
);
39+
if (artifact?.ast) {
40+
for (const astNode of artifact.ast.nodes) {
41+
if (astNode.nodeType == "ContractDefinition") {
42+
if (astNode.baseContracts.length > 0) {
43+
inheritedFromContracts = astNode.baseContracts.map(
44+
({ baseName }) => baseName.name
45+
);
46+
}
4547
}
4648
}
4749
}

0 commit comments

Comments
 (0)