mirror of
https://gitlab.com/pulsechaincom/go-pulse.git
synced 2024-12-25 12:57:17 +00:00
Always return something valid
This commit is contained in:
parent
c44f4f32fe
commit
b368549fd5
@ -276,6 +276,11 @@ func (self *JSFilter) MessagesToJson(messages ethstate.Messages) string {
|
||||
msgs = append(msgs, NewJSMessage(m))
|
||||
}
|
||||
|
||||
// Return an empty array instead of "null"
|
||||
if len(msgs) == 0 {
|
||||
return "[]"
|
||||
}
|
||||
|
||||
b, err := json.Marshal(msgs)
|
||||
if err != nil {
|
||||
return "{\"error\":" + err.Error() + "}"
|
||||
|
Loading…
Reference in New Issue
Block a user