summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDennis Francis <dennis.francis@collabora.com>2020-06-15 19:56:59 +0530
committerMichael Meeks <michael.meeks@collabora.com>2020-06-16 11:35:35 +0200
commit962edaafd2807f5f3a5819b5b87b147f876280f9 (patch)
treeaad991df212ef6e8fe9fe35073dffec0c3bb2305
parentGuard against uncaught exception when tileContainer.style is undefined (diff)
downloadonline-962edaafd2807f5f3a5819b5b87b147f876280f9.tar.gz
online-962edaafd2807f5f3a5819b5b87b147f876280f9.zip
jsonString: allow json messages without white-spaces after '{'
The json generated by boost::property_tree::write_json() has no white-spaces around { , : } json-characters. We use write_json() extensively in core.git. Without this patch we will need work-arounds like inserting spaces in the json strings thus generated to work with online's Message::jsonString() Change-Id: I0f0631088f4a8b727301bde449884e03163093f0 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96383 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> (cherry picked from commit bc7a0b262664032769b2dde3a31151f23ffd5235) Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96417
-rw-r--r--common/Message.hpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/Message.hpp b/common/Message.hpp
index cb27e2c97b..7bbadd1720 100644
--- a/common/Message.hpp
+++ b/common/Message.hpp
@@ -97,7 +97,7 @@ public:
/// Returns the json part of the message, if any.
std::string jsonString() const
{
- if (_tokens.size() > 1 && _tokens[1] == "{")
+ if (_tokens.size() > 1 && _tokens[1].size() && _tokens[1][0] == '{')
{
const size_t firstTokenSize = _tokens[0].size();
return std::string(_data.data() + firstTokenSize, _data.size() - firstTokenSize);