loolwsd/Storage.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
New commits: commit 519eb567baf9bec1ba83199d1c16a11b024cc90a Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk> Date: Wed Aug 31 19:38:27 2016 -0400 loolwsd: tolerate missing WOPI username Change-Id: Ied24b5562f63ecdd96ee6ac7fd312b3bb5599573 Reviewed-on: https://gerrit.libreoffice.org/28573 Reviewed-by: Ashod Nakashian <ashnak...@gmail.com> Tested-by: Ashod Nakashian <ashnak...@gmail.com> diff --git a/loolwsd/Storage.cpp b/loolwsd/Storage.cpp index 3e2d346..a4043b3 100644 --- a/loolwsd/Storage.cpp +++ b/loolwsd/Storage.cpp @@ -290,9 +290,11 @@ StorageBase::FileInfo WopiStorage::getFileInfo(const Poco::URI& uri) const auto result = parser.parse(stringJSON); const auto& object = result.extract<Poco::JSON::Object::Ptr>(); filename = object->get("BaseFileName").toString(); - size = std::stoul (object->get("Size").toString(), nullptr, 0); - userId = object->get("UserId").toString(); - userName = object->get("UserFriendlyName").toString(); + size = std::stoul(object->get("Size").toString(), nullptr, 0); + const auto userIdVar = object->get("UserId"); + userId = (userIdVar.isString() ? userIdVar.toString() : ""); + const auto userNameVar = object->get("UserFriendlyName"); + userName = (userNameVar.isString() ? userNameVar.toString() : "anonymous"); } // WOPI doesn't support file last modified time. _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits