aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ethpipe/js_pipe.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/ethpipe/js_pipe.go b/ethpipe/js_pipe.go
index 8f08a7c5f..b32e94a10 100644
--- a/ethpipe/js_pipe.go
+++ b/ethpipe/js_pipe.go
@@ -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() + "}"