Skip to content

Commit

Permalink
do not return nil when no filter changes are found
Browse files Browse the repository at this point in the history
  • Loading branch information
hexoscott committed Oct 19, 2023
1 parent 82a2143 commit d37978f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions jsonrpc/filter_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,13 @@ func (f *FilterManager) GetFilterChanges(id string) (interface{}, error) {
f.Unlock()
}

// if the result is nil then return an empty array to save the response going back to the client
// as null
r, ok := res.([]*Log)
if ok && len(r) == 0 {
return []interface{}{}, nil
}

return res, err
}

Expand Down

0 comments on commit d37978f

Please sign in to comment.