Skip to content

Commit

Permalink
Initialize unmarshaled contract's Networks map if nil.
Browse files Browse the repository at this point in the history
  • Loading branch information
BogdanHabic committed May 28, 2020
1 parent 991a9c3 commit 2bd857c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions truffle/contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ func GetTruffleContracts(buildDir string, networkIDs []string, objects ...*model
return nil, 0, errors.Wrap(err, "failed parsing truffle build file")
}

if contract.Networks == nil {
contract.Networks = make(map[string]ContractNetwork)
}

sources[contract.SourcePath] = true
for _, node := range contract.Ast.Nodes {
if node.NodeType != "ImportDirective" {
Expand Down

0 comments on commit 2bd857c

Please sign in to comment.