summaryrefslogtreecommitdiff
path: root/sw/source/uibase/utlui/content.cxx
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2023-09-16 22:20:04 +0200
committerJulien Nabet <serval2412@yahoo.fr>2023-09-17 11:36:17 +0200
commit8f55b9fccda8abe690693d8630a9a52369f984ec (patch)
tree6457d4730f71003e386f49db87a9ab2cbeb73bca /sw/source/uibase/utlui/content.cxx
parenta4522ef5ce6a625054d83ec907aee07c156e94ed (diff)
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 <serval2412@yahoo.fr>
Diffstat (limited to 'sw/source/uibase/utlui/content.cxx')
-rw-r--r--sw/source/uibase/utlui/content.cxx3
1 files changed, 3 insertions, 0 deletions
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;