Skip to content

Commit

Permalink
console: fix return via callbacks (ethereum#2910)
Browse files Browse the repository at this point in the history
  • Loading branch information
cdetrio authored and fjl committed Aug 15, 2016
1 parent d6625ac commit 077353b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions console/bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,8 @@ func (b *bridge) Send(call otto.FunctionCall) (response otto.Value) {
} else {
response, _ = resps.Get("0")
}
if fn := call.Argument(1).Object(); fn != nil && fn.Class() == "function" {
fn.Call("apply", response)
if fn := call.Argument(1); fn.Class() == "Function" {
fn.Call(otto.NullValue(), otto.NullValue(), response)
return otto.UndefinedValue()
}
return response
Expand Down

0 comments on commit 077353b

Please sign in to comment.