sw/source/uibase/utlui/content.cxx | 3 +++ 1 file changed, 3 insertions(+)
New commits: commit d29a70a875c5c423eec3f6549ae399ee46049eb2 Author: Julien Nabet <serval2...@yahoo.fr> AuthorDate: Sat Sep 16 22:20:04 2023 +0200 Commit: László Németh <nem...@numbertext.org> CommitDate: Sun Sep 17 20:10:14 2023 +0200 tdf#157277: fix Writer crash when hiding Sidebar + using bookmark in Navigator Relevant part of bt (from exception thrown): 1 0x00007f00b5398a34 in SfxUnoDecks::getByName(rtl::OUString const&) (this=0x559ce97aff60, aName="NavigatorDeck") at /home/julien/lo/libreoffice/sfx2/source/sidebar/UnoDecks.cxx:45 2 0x00007f00b5398edf in non-virtual thunk to SfxUnoDecks::getByName(rtl::OUString const&) () at /home/julien/lo/libreoffice/instdir/program/libsfxlo.so 3 0x00007f008bc016a5 in SwContentTree::GotoContent(SwContent const*) (this=0x559ce849e850, pCnt=0x559ce4b8cc10) at /home/julien/lo/libreoffice/sw/source/uibase/utlui/content.cxx:5463 See full bts (initial + from exception thrown) here: https://bugs.documentfoundation.org/attachment.cgi?id=189632 Test if xDecks has "NavigatorDeck" before trying to retrieve it since it seems it's not the case when sidebar disabled. Change-Id: Ia0aa64ebf26ad06fd4fe4b14f949453ae7948456 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156978 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2...@yahoo.fr> (cherry picked from commit 18380cbe922730265cac17d2b710911a2db8f631) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156954 Tested-by: László Németh <nem...@numbertext.org> Reviewed-by: László Németh <nem...@numbertext.org> diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index c2af6a16304d..5114761fe939 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -5410,6 +5410,9 @@ void SwContentTree::GotoContent(const SwContent* pCnt) if ( !xDecks.is() ) break; + if (!xDecks->hasByName("NavigatorDeck")) + break; + Reference<ui::XDeck> xDeck ( xDecks->getByName("NavigatorDeck"), uno::UNO_QUERY); if ( !xDeck.is() ) break;