[Libreoffice-commits] online.git: wsd/DocumentBroker.cpp

Ashod Nakashian ashod.nakashian at collabora.co.uk
Wed Jan 4 04:23:39 UTC 2017


 wsd/DocumentBroker.cpp |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 95ff7ba2d735e28321027935228594f3d40f718a
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Tue Jan 3 15:47:31 2017 -0500

    wsd: don't access erased iterator
    
    Change-Id: I7d9c85b11cd0ea96700c7302c23b5d4b30ce9fa2
    Reviewed-on: https://gerrit.libreoffice.org/32710
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index 53ead02..232b109 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -657,6 +657,7 @@ size_t DocumentBroker::removeSession(const std::string& id)
         auto it = _sessions.find(id);
         if (it != _sessions.end())
         {
+            const auto readonly = (it->second ? it->second->isReadOnly() : false);
             _sessions.erase(it);
 
             // Let the child know the client has disconnected.
@@ -664,7 +665,7 @@ size_t DocumentBroker::removeSession(const std::string& id)
             _childProcess->sendTextFrame(msg);
 
             const auto count = _sessions.size();
-            LOG_TRC("Removed " << (it->second->isReadOnly() ? "readonly" : "non-readonly") <<
+            LOG_TRC("Removed " << (readonly ? "readonly" : "non-readonly") <<
                     " session [" << id << "] from docKey [" <<
                     _docKey << "] to have " << count << " sessions.");
             return count;


More information about the Libreoffice-commits mailing list