File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
templates/extensions/foundry/packages/foundry/script Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -36,12 +36,14 @@ function getArtifactOfContract(contractName) {
36
36
37
37
function getInheritedFromContracts ( artifact ) {
38
38
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
+ }
45
47
}
46
48
}
47
49
}
You can’t perform that action at this time.
0 commit comments