summaryrefslogtreecommitdiffstats
path: root/src/uscxml/Message.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/uscxml/Message.cpp')
-rw-r--r--src/uscxml/Message.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/uscxml/Message.cpp b/src/uscxml/Message.cpp
index 0898cc7..c3f4281 100644
--- a/src/uscxml/Message.cpp
+++ b/src/uscxml/Message.cpp
@@ -188,13 +188,16 @@ Data Data::fromJSON(const std::string& jsonString) {
if (trimmed.length() == 0)
return data;
+ if (trimmed.find_first_of("{[") != 0)
+ return data;
+
jsmn_parser p;
jsmntok_t* t = NULL;
// we do not know the number of tokens beforehand, start with something sensible and increase
int rv;
- int frac = 16; // this will get decreased to 16 to first iteration for 1/16 length/token ratio
+ int frac = 16; // length/token ratio
do {
jsmn_init(&p);