[Libreoffice-commits] online.git: loolwsd/Storage.cpp
Ashod Nakashian
ashod.nakashian at collabora.co.uk
Thu Sep 1 03:57:29 UTC 2016
loolwsd/Storage.cpp | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
New commits:
commit 93082681441cfb4c073601bc7ae4b71449d5cd69
Author: Ashod Nakashian <ashod.nakashian at 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 <ashnakash at gmail.com>
Tested-by: Ashod Nakashian <ashnakash at gmail.com>
diff --git a/loolwsd/Storage.cpp b/loolwsd/Storage.cpp
index e066f6f..3b71f16 100644
--- a/loolwsd/Storage.cpp
+++ b/loolwsd/Storage.cpp
@@ -291,9 +291,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.
More information about the Libreoffice-commits
mailing list