From 4df2b8274af74058683c5a9cef8620fb083998fa Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 18 Apr 2021 19:39:09 +0100 Subject: cid#1476278 silence Null pointer dereferences MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I8b98551c284d04378fe6dfa254be4f5f09efd9e6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114249 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- sw/source/core/unocore/unosrch.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sw') diff --git a/sw/source/core/unocore/unosrch.cxx b/sw/source/core/unocore/unosrch.cxx index db0a98b2e7ea..d4816e5b009a 100644 --- a/sw/source/core/unocore/unosrch.cxx +++ b/sw/source/core/unocore/unosrch.cxx @@ -150,7 +150,9 @@ void SwSearchProperties_Impl::FillItemSet(SfxItemSet& rSet, bool bIsValueSearch) for(auto const & rPair : maValues) { SfxPoolItem* pTempItem = nullptr; - const SfxItemPropertyMapEntry & rPropEntry = *mrMap.getByName(rPair.first); + const SfxItemPropertyMapEntry* pPropEntry = mrMap.getByName(rPair.first); + assert(pPropEntry && "SetProperties only enters values into maValues if mrMap.hasPropertyByName() wass true"); + const SfxItemPropertyMapEntry & rPropEntry = *pPropEntry; sal_uInt16 nWID = rPropEntry.nWID; switch(nWID) { -- cgit v1.2.3