From b368549fd5d54ca5c73f424273a9d3896ad456a0 Mon Sep 17 00:00:00 2001 From: obscuren Date: Thu, 21 Aug 2014 15:12:13 +0200 Subject: Always return something valid --- ethpipe/js_pipe.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ethpipe/js_pipe.go') 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() + "}" -- cgit