aboutsummaryrefslogtreecommitdiffstats
path: root/ethpipe
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-08-21 21:12:13 +0800
committerobscuren <geffobscura@gmail.com>2014-08-21 21:12:13 +0800
commitb368549fd5d54ca5c73f424273a9d3896ad456a0 (patch)
tree9a4a38d9e8a9c929458393593f2bcdcca8f51fea /ethpipe
parentc44f4f32fe9d72634574b909655d159ec153ea7d (diff)
downloadgo-tangerine-b368549fd5d54ca5c73f424273a9d3896ad456a0.tar
go-tangerine-b368549fd5d54ca5c73f424273a9d3896ad456a0.tar.gz
go-tangerine-b368549fd5d54ca5c73f424273a9d3896ad456a0.tar.bz2
go-tangerine-b368549fd5d54ca5c73f424273a9d3896ad456a0.tar.lz
go-tangerine-b368549fd5d54ca5c73f424273a9d3896ad456a0.tar.xz
go-tangerine-b368549fd5d54ca5c73f424273a9d3896ad456a0.tar.zst
go-tangerine-b368549fd5d54ca5c73f424273a9d3896ad456a0.zip
Always return something valid
Diffstat (limited to 'ethpipe')
-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() + "}"