From d90691e853713564dba68ca14e6cf59156d91589 Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Thu, 23 Jan 2014 14:58:15 +0200 Subject: [PATCH] Fixed getBeforeAndAfterNamesAbsolute NULL handling --- modules/remotebackend/remotebackend.cc | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/modules/remotebackend/remotebackend.cc b/modules/remotebackend/remotebackend.cc index e3243fc97..7a63d94b6 100644 --- a/modules/remotebackend/remotebackend.cc +++ b/modules/remotebackend/remotebackend.cc @@ -287,9 +287,20 @@ bool RemoteBackend::getBeforeAndAfterNamesAbsolute(uint32_t id, const std::strin if (this->send(query) == false || this->recv(answer) == false) return false; - unhashed = getString(answer["result"]["unhashed"]); - before = getString(answer["result"]["before"]); - after = getString(answer["result"]["after"]); + if (answer["result"]["unhashed"].IsNull()) + unhashed = ""; + else + unhashed = getString(answer["result"]["unhashed"]); + + if (answer["result"]["before"].IsNull()) + before = ""; + else + before = getString(answer["result"]["before"]); + + if (answer["result"]["after"].IsNull()) + after = ""; + else + after = getString(answer["result"]["after"]); return true; } -- 2.40.0