sw/source/uibase/utlui/content.cxx | 3 +++ 1 file changed, 3 insertions(+)
New commits: commit 8f55b9fccda8abe690693d8630a9a52369f984ec Author: Julien Nabet <serval2...@yahoo.fr> AuthorDate: Sat Sep 16 22:20:04 2023 +0200 Commit: Julien Nabet <serval2...@yahoo.fr> CommitDate: Sun Sep 17 11:36:17 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> diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 1bc5bfe2e4d8..ca6a16dbe10d 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -5460,6 +5460,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;