diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-12-25 22:11:59 +0000 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-12-26 11:52:52 +0100 |
commit | dd5fda4fef0526262977d5f9262ce09e27286d01 (patch) | |
tree | a93c292df64f6736df3a82660e3c2fc7f81c5326 | |
parent | aa318cc3160841c2b22479cee7bf8941cf7e0d96 (diff) |
cid#1559938 Dereference null return value
Change-Id: I9e4fd4a3c2cf56bb50e765cf64401ac7aa80847c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161291
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
-rw-r--r-- | sd/source/ui/dlg/LayerTabBar.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sd/source/ui/dlg/LayerTabBar.cxx b/sd/source/ui/dlg/LayerTabBar.cxx index ece1e0884bcf..49a09a147936 100644 --- a/sd/source/ui/dlg/LayerTabBar.cxx +++ b/sd/source/ui/dlg/LayerTabBar.cxx @@ -179,7 +179,12 @@ void LayerTabBar::BringLayerObjectsToAttention(const sal_uInt16 nPageId) { SdrObject* pObj = aIter.Next(); assert(pObj != nullptr); - if (pObj && (aLayerName == rLayerAdmin.GetLayerPerID(pObj->GetLayer())->GetName())) + if (!pObj) + continue; + const SdrLayer* pSdrLayer = rLayerAdmin.GetLayerPerID(pObj->GetLayer()); + if (!pSdrLayer) + continue; + if (aLayerName == pSdrLayer->GetName()) { ::tools::Rectangle aRect(pObj->GetLogicRect()); if (!aRect.IsEmpty()) |