From 057a5f56a11a47da9cc7015b6d0718e57c442034 Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Thu, 15 Dec 2022 17:15:10 +0100 Subject: svx: fix null deref in ParaLineSpacingControl::ExecuteLineSpacing See https://crashreport.libreoffice.org/stats/signature/svx::ParaLineSpacingControl::ExecuteLineSpacing(long) Change-Id: Ide29a7e78bf1114f0ebc104fa8c245e52d590eea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144239 Tested-by: Jenkins Reviewed-by: Xisco Fauli --- svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'svx') diff --git a/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx b/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx index 9ff16f340b15..4283f3651136 100644 --- a/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx +++ b/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx @@ -423,8 +423,12 @@ void ParaLineSpacingControl::ExecuteLineSpacing(sal_Int32 nEntry) SetLineSpace(aSpacing, nEntry); - SfxViewFrame::Current()->GetBindings().GetDispatcher()->ExecuteList( - SID_ATTR_PARA_LINESPACE, SfxCallMode::RECORD, { &aSpacing }); + SfxViewFrame* pCurrent = SfxViewFrame::Current(); + if( pCurrent ) + { + pCurrent->GetBindings().GetDispatcher()->ExecuteList( + SID_ATTR_PARA_LINESPACE, SfxCallMode::RECORD, { &aSpacing }); + } // close when the user used the buttons mxControl->EndPopupMode(); -- cgit