Skip to content

Commit

Permalink
fix a problem where the JSON is already parsed
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohamed Ahmed Fouad committed Dec 8, 2015
1 parent 2868054 commit 9364d75
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ocnode/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ function interact(client,m,print) {
if (print == undefined) print = true;
if (print) pcontainer(client.name+': '+m.type,m);
$.post('http://localhost:6789/',m.toJson(),function(data) {
var parsed = JSON.parse(data);
if (typeof data == 'string') parsed = JSON.parse(data);
else parsed = data;
var reply = client.parseData(parsed);
var out = client.callHandler(reply);
if (print) pcontainer(client.name+': '+reply.type,reply);
Expand Down

0 comments on commit 9364d75

Please sign in to comment.