Skip to content

Commit

Permalink
queries: allow 0-weigth (ignore payload) (#9)
Browse files Browse the repository at this point in the history
Fix slice bounds out of range panic
  • Loading branch information
holiman committed Nov 3, 2020
1 parent 9acce12 commit fadf98c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions queries.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ func installDefaults(gen *generator, methods map[string]int64) error {
}

for method, weight := range methods {
if weight == 0 {
continue
}
if _, err := rpcMethod[method]; err == false {
return errors.New(method + " is not supported")
}
Expand Down

0 comments on commit fadf98c

Please sign in to comment.