Skip to content

Commit

Permalink
rlp/rlpgen: fix error handling when target type not found (ethereum#2…
Browse files Browse the repository at this point in the history
…5547)

typ will be nil when lookupStructType returns an error. cfg.Type should be used instead.
  • Loading branch information
jtraglia authored and HanWang233 committed Sep 11, 2022
1 parent 439ddc4 commit 8eb8a16
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rlp/rlpgen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func (cfg *Config) process() (code []byte, err error) {
// Find the type and generate.
typ, err := lookupStructType(pkg.Scope(), cfg.Type)
if err != nil {
return nil, fmt.Errorf("can't find %s in %s: %v", typ, pkg, err)
return nil, fmt.Errorf("can't find %s in %s: %v", cfg.Type, pkg, err)
}
code, err = bctx.generate(typ, cfg.GenerateEncoder, cfg.GenerateDecoder)
if err != nil {
Expand Down

0 comments on commit 8eb8a16

Please sign in to comment.