sw/source/uibase/sidebar/PageMarginControl.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
New commits: commit 833e4d059aae5f3a66c70f9f3d8dc1ab4c931322 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Tue Aug 16 09:34:18 2022 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Wed Aug 17 00:38:09 2022 +0200 cid#1509262 Explicit null dereferenced Change-Id: I65eab19b3b40fae6f6b88e4dd3cf21934dd3fd95 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138373 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/sw/source/uibase/sidebar/PageMarginControl.cxx b/sw/source/uibase/sidebar/PageMarginControl.cxx index 632e94140e4f..f6e0caa727bc 100644 --- a/sw/source/uibase/sidebar/PageMarginControl.cxx +++ b/sw/source/uibase/sidebar/PageMarginControl.cxx @@ -204,8 +204,11 @@ PageMarginControl::PageMarginControl(PageMarginPopup* pControl, weld::Widget* pP SetMetricValue( *m_xBottomMarginEdit, m_nPageBottomMargin, m_eUnit ); SetFieldUnit( *m_xBottomMarginEdit, lcl_GetFieldUnit() ); - m_aPageSize = pSize->GetSize(); - SetMetricFieldMaxValues( m_aPageSize ); + if (pSize) + { + m_aPageSize = pSize->GetSize(); + SetMetricFieldMaxValues( m_aPageSize ); + } if ( m_bMirrored ) {