loolwsd/DocumentBroker.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-)
New commits: commit e85d726c6cf0a2eb73ac6562688935ca60cea0c7 Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk> Date: Sun Apr 10 12:30:33 2016 -0400 loolwsd: use the first valid session for auto-saving Change-Id: I3d860c9f91de56f84ae93dc93688cd4898128107 Reviewed-on: https://gerrit.libreoffice.org/23963 Reviewed-by: Ashod Nakashian <ashnak...@gmail.com> Tested-by: Ashod Nakashian <ashnak...@gmail.com> diff --git a/loolwsd/DocumentBroker.cpp b/loolwsd/DocumentBroker.cpp index 862b298..3df2254 100644 --- a/loolwsd/DocumentBroker.cpp +++ b/loolwsd/DocumentBroker.cpp @@ -174,7 +174,22 @@ void DocumentBroker::autoSave() Log::info("Auto-save triggered for doc [" + _docKey + "]."); // Any session can be used to save. - _wsSessions.begin()->second->getQueue()->put("uno .uno:Save"); + bool sent = false; + for (auto& sessionIt: _wsSessions) + { + auto queue = sessionIt.second->getQueue(); + if (queue) + { + queue->put("uno .uno:Save"); + sent = true; + break; + } + } + + if (!sent) + { + Log::error("Failed to save doc [" + _docKey + "]: No valid sessions."); + } } } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits