Permalink
Browse files

empty jsonpath should return << >>

  • Loading branch information...
1 parent 679a7ad commit 2dbe72eab99f02abffb2daaa32334e0334c56724 @nniclausse nniclausse committed Aug 20, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/tsung/ts_client.erl
View
5 src/tsung/ts_client.erl
@@ -490,7 +490,10 @@ set_dynvars(file,{iter,FileId,Delimiter},_Vars,_DynData,_) ->
set_dynvars(jsonpath,{JSONPath, From},_Vars,DynData,_) ->
{ok, Val} = ts_dynvars:lookup(From,DynData#dyndata.dynvars),
JSON=mochijson2:decode(Val),
- ts_utils:jsonpath(JSONPath, JSON);
+ case ts_utils:jsonpath(JSONPath, JSON) of
+ undefined -> << >>;
+ V -> V
+ end;
set_dynvars(server,_,_,_,{Host,Port}) ->
[Host,Port].

0 comments on commit 2dbe72e

Please sign in to comment.