Commit b368549f authored by obscuren's avatar obscuren

Always return something valid

parent c44f4f32
......@@ -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() + "}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment