summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2023-12-21 20:20:29 +0000
committerAdolfo Jayme Barrientos <fitojb@ubuntu.com>2023-12-21 23:32:39 +0100
commitd58baf4aba25999afc16c7c0429963ab7d29eaf4 (patch)
tree250806fa3045ee252264b3d83983dfa2fd1d31c1
parent274380def4cdbf4cec86951c3a539b88043aa048 (diff)
cid#1559856 Dereference after null check
we check for a null pOldSh earlier, so logically we need to check here too, or drop the other null check Change-Id: I8a9110a9d1ee753f523101862fa62e20760bdb1d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161156 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
-rw-r--r--sfx2/source/view/viewfrm.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 24bea7e809cd..57fbb91d5d66 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -2548,7 +2548,8 @@ bool SfxViewFrame::SwitchToViewShell_Impl
// save the view data of the old view, so it can be restored later on (when needed)
SaveCurrentViewData_Impl( nViewId );
- pOldSh->SetDying();
+ if (pOldSh)
+ pOldSh->SetDying();
// create and load new ViewShell
SfxViewShell* pNewSh = LoadViewIntoFrame_Impl(