From 46cfd8d2a7a06fb5c04c027ce641a766af8a337a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Sun, 8 Dec 2024 11:42:12 +0000 Subject: [PATCH] cid#1636664 Dereference after null check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I916212471a80417a582192920427999ee6a425d2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178078 Reviewed-by: Caolán McNamara Tested-by: Jenkins --- sw/source/core/unocore/unostyle.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index 44b710f6d8fc..098750ab418d 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -956,11 +956,11 @@ rtl::Reference SwXStyleFamily::getParagraphStyleByName(const OUString& rtl::Reference SwXStyleFamily::getStyleByName(const OUString& rName) { SolarMutexGuard aGuard; + if(!m_pBasePool) + throw uno::RuntimeException(); OUString sStyleName; SwStyleNameMapper::FillUIName(rName, sStyleName, m_rEntry.poolId(), !m_pDocShell->GetDoc()->IsInWriterfilterImport()); - if(!m_pBasePool) - throw uno::RuntimeException(); SfxStyleSheetBase* pBase = m_pBasePool->Find(sStyleName, m_rEntry.family()); if(!pBase) throw container::NoSuchElementException(rName); @@ -1104,7 +1104,7 @@ void SwXStyleFamily::replaceByName(const OUString& rName, const uno::Any& rEleme throw uno::RuntimeException(); OUString sStyleName; SwStyleNameMapper::FillUIName(rName, sStyleName, m_rEntry.poolId(), - m_pDocShell && !m_pDocShell->GetDoc()->IsInWriterfilterImport()); + !m_pDocShell->GetDoc()->IsInWriterfilterImport()); SfxStyleSheetBase* pBase = m_pBasePool->Find(sStyleName, m_rEntry.family()); // replacements only for userdefined styles if(!pBase)