[Libreoffice-commits] online.git: common/Session.cpp

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Thu Mar 19 10:51:14 UTC 2020


 common/Session.cpp |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit d6fe0979b71ecc864257ff4595d2ffd27cc449d0
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Thu Mar 19 09:12:33 2020 +0100
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Thu Mar 19 11:50:54 2020 +0100

    common: handle missing protocol in Session::getIOStats()
    
    This sometimes causes unit-integration to fail and now is consistent
    with other member functions of Session that handle missing protocol.
    
    Change-Id: I43c7fcae964cfcb5911ff57d63bd4cb569e6b97c
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90732
    Tested-by: Michael Meeks <michael.meeks at collabora.com>
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>

diff --git a/common/Session.cpp b/common/Session.cpp
index d24b615a9..859cd011e 100644
--- a/common/Session.cpp
+++ b/common/Session.cpp
@@ -257,6 +257,12 @@ void Session::handleMessage(const std::vector<char> &data)
 
 void Session::getIOStats(uint64_t &sent, uint64_t &recv)
 {
+    if (!_protocol)
+    {
+        LOG_TRC("ERR - missing protocol " << getName() << ": Get IO stats.");
+        return;
+    }
+
     _protocol->getIOStats(sent, recv);
 }
 


More information about the Libreoffice-commits mailing list