pShell can be null here

...e.g., when opening "Tools - Options... - LibreOffice - Colors" from the Start
Center.

Change-Id: Id83591996e03794dc7dc53ccda58df7d7624ff8d
This commit is contained in:
Stephan Bergmann
2016-08-19 16:49:42 +02:00
parent 0bc553f3ef
commit e774d798f6

View File

@@ -194,8 +194,11 @@ void PaletteManager::SetPalette( sal_Int32 nPos )
if(pColorList->Load()) if(pColorList->Load())
{ {
SfxObjectShell* pShell = SfxObjectShell::Current(); SfxObjectShell* pShell = SfxObjectShell::Current();
SvxColorListItem aColorItem(pColorList, SID_COLOR_TABLE); if (pShell != nullptr)
pShell->PutItem( aColorItem ); {
SvxColorListItem aColorItem(pColorList, SID_COLOR_TABLE);
pShell->PutItem( aColorItem );
}
} }
} }
std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create(m_context)); std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create(m_context));