sw/source/uibase/uno/unotxdoc.cxx | 2 ++ 1 file changed, 2 insertions(+)
New commits: commit 7ee46ef56bf07fbee3f1c2f87262c6f34436c543 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Thu Nov 14 15:11:13 2024 +0000 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Thu Nov 14 17:18:21 2024 +0100 m_pDocShell seen as null in SwXTextDocument::getPostIts #2 SwView::GetPostItMgr (this=<error reading variable: Cannot access memory at address 0xc8>) at sw/inc/view.hxx:659 #3 SwXTextDocument::getPostIts(tools::JsonWriter&) () at sw/source/uibase/uno/unotxdoc.cxx:3351 #4 0x00007f6238ac7cc8 in getPostIts (pThis=0x36aa6cb0) at /opt/rh/devtoolset-12/root/usr/include/c++/12/ext/atomicity.h:111 #5 doc_getCommandValues () at desktop/source/lib/init.cxx:6739 #6 0x00000000005863e0 in lok::Document::getCommandValues (pCommand=<optimized out>, this=<optimized out>) at /home/collabora/jenkins/workspace/package_cool_24.04_rpm/rpmbuild/BUILD/coolwsd-24.04.9.2snapshot/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx:492 #7 ChildSession::getCommandValues(StringVector const&) () at kit/ChildSession.cpp:1180 Change-Id: Ib2a3c2e7eb1a108ad969588f6c313cade145e8ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176600 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Andras Timar <andras.ti...@collabora.com> (cherry picked from commit c0542a438d91051bcdab1f5bc19ee46c90bd91a7) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176605 Tested-by: Andras Timar <andras.ti...@collabora.com> diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index 03bb7fc1cf1a..19045dfd5605 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -3348,6 +3348,8 @@ void SwXTextDocument::getPostIts(tools::JsonWriter& rJsonWriter) { SolarMutexGuard aGuard; auto commentsNode = rJsonWriter.startArray("comments"); + if (!m_pDocShell) + return; for (auto const& sidebarItem : *m_pDocShell->GetView()->GetPostItMgr()) { sw::annotation::SwAnnotationWin* pWin = sidebarItem->mpPostIt.get();