From 177f2e662578ff1127eb83723c509868839d2eaa Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Tue, 9 Jul 2019 17:20:07 +0200 Subject: [PATCH] Fix js builder --- OsmAnd/src/net/osmand/plus/voice/JSCommandBuilder.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/voice/JSCommandBuilder.java b/OsmAnd/src/net/osmand/plus/voice/JSCommandBuilder.java index e39fe3828c..87e340e8b8 100644 --- a/OsmAnd/src/net/osmand/plus/voice/JSCommandBuilder.java +++ b/OsmAnd/src/net/osmand/plus/voice/JSCommandBuilder.java @@ -56,8 +56,14 @@ public class JSCommandBuilder extends CommandBuilder { private JSCommandBuilder addCommand(String name, Object... args){ listCommands.add(name); - listCommands.add(Arrays.toString(args)); - Object obj = jsScope.get(name); + for(Object o : args) { + if(o != null) { + listCommands.add(o.toString()); + } else { + listCommands.add(""); + } + } + Object obj = jsScope.get(name); if (obj instanceof Function) { Function jsFunction = (Function) obj; Object jsResult = jsFunction.call(jsContext, jsScope, jsScope, args);