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 blakehhuynh committed Oct 3, 2022
1 parent 1220c7c commit 1388091
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rlp/rlpgen/main.go
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 1388091

Please sign in to comment.