don't assert in this case, better to return

Change-Id: I38cef1185bef0de67bbb579c5c64e2697f953b0b
Reviewed-on: https://gerrit.libreoffice.org/64297
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
This commit is contained in:
Tomaž Vajngerl 2018-11-29 22:10:47 +01:00 committed by Tomaž Vajngerl
parent 9e61f831f0
commit 2645829f40

View file

@ -1367,10 +1367,12 @@ bool ChildSession::signDocumentContent(const char* buffer, int length, const std
Poco::JSON::Parser parser;
Poco::JSON::Object::Ptr root = parser.parse(json).extract<Poco::JSON::Object::Ptr>();
for (auto& chainPtr : *root->getArray("chain"))
for (auto& rChainPtr : *root->getArray("chain"))
{
assert(chainPtr.isString());
std::string chainCertificate = chainPtr;
if (!rChainPtr.isString())
return false;
std::string chainCertificate = rChainPtr;
std::vector<unsigned char> binaryChainCertificate = decodeBase64(extractCertificate(chainCertificate));
bResult = getLOKitDocument()->addCertificate(