diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx index 61b54eb870b5..4a8544635b32 100644 --- a/sc/source/ui/dbgui/tpsort.cxx +++ b/sc/source/ui/dbgui/tpsort.cxx @@ -273,7 +273,7 @@ sal_Bool ScTabPageSortFields::FillItemSet( SfxItemSet& rArgSet ) // If the "OK" was selected on the Options page while the sort // direction was changed, then the first field (i.e. nFieldArr[0]) // of the respective direction is chosen as the sorting criterion: - if ( bSortByRows != pDlg->GetByRows() ) + if ( pDlg && bSortByRows != pDlg->GetByRows() ) { for ( sal_uInt16 i=0; i