cid#1636664 Dereference after null check

Change-Id: I916212471a80417a582192920427999ee6a425d2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178078
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
This commit is contained in:
Caolán McNamara 2024-12-08 11:42:12 +00:00
parent 4a09777d8f
commit 46cfd8d2a7

View file

@ -956,11 +956,11 @@ rtl::Reference<SwXStyle> SwXStyleFamily::getParagraphStyleByName(const OUString&
rtl::Reference<SwXBaseStyle> 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)