[Libreoffice-commits] online.git: loolwsd/PrisonerSession.cpp

Henry Castro hcastro at collabora.com
Sun Aug 28 13:00:20 UTC 2016


 loolwsd/PrisonerSession.cpp |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d36ff0afdab125e72fef23f27b7ed90397e57fb3
Author: Henry Castro <hcastro at collabora.com>
Date:   Sun Aug 28 08:41:24 2016 -0400

    loolwsd: avoid exception, commandName empty

diff --git a/loolwsd/PrisonerSession.cpp b/loolwsd/PrisonerSession.cpp
index 1dc9cbe..ba3c344 100644
--- a/loolwsd/PrisonerSession.cpp
+++ b/loolwsd/PrisonerSession.cpp
@@ -203,7 +203,7 @@ bool PrisonerSession::_handleInput(const char *buffer, int length)
                 Poco::JSON::Parser parser;
                 const auto result = parser.parse(stringJSON);
                 const auto& object = result.extract<Poco::JSON::Object::Ptr>();
-                const std::string commandName = object->get("commandName").toString();
+                const std::string commandName = object->has("commandName") ? object->get("commandName").toString() : "";
                 if (commandName.find(".uno:CharFontName") != std::string::npos ||
                     commandName.find(".uno:StyleApply") != std::string::npos)
                 {


More information about the Libreoffice-commits mailing list