diff --git a/svx/source/tbxctrls/PaletteManager.cxx b/svx/source/tbxctrls/PaletteManager.cxx index cccf1672bc24..c2c9748cf461 100644 --- a/svx/source/tbxctrls/PaletteManager.cxx +++ b/svx/source/tbxctrls/PaletteManager.cxx @@ -194,8 +194,11 @@ void PaletteManager::SetPalette( sal_Int32 nPos ) if(pColorList->Load()) { SfxObjectShell* pShell = SfxObjectShell::Current(); - SvxColorListItem aColorItem(pColorList, SID_COLOR_TABLE); - pShell->PutItem( aColorItem ); + if (pShell != nullptr) + { + SvxColorListItem aColorItem(pColorList, SID_COLOR_TABLE); + pShell->PutItem( aColorItem ); + } } } std::shared_ptr batch(comphelper::ConfigurationChanges::create(m_context));