Fix crash if the palette popup cannot be loaded

Related to #756
This commit is contained in:
David Capello 2015-08-19 17:50:54 -03:00
parent 96e4244304
commit c06cc876d1

View File

@ -451,8 +451,15 @@ void ColorBar::onPaletteButtonClick()
}
case PalButton::PRESETS: {
if (!m_palettePopup)
m_palettePopup.reset(new PalettePopup());
if (!m_palettePopup) {
try {
m_palettePopup.reset(new PalettePopup());
}
catch (const std::exception& ex) {
Console::showException(ex);
return;
}
}
if (!m_palettePopup->isVisible()) {
gfx::Rect bounds = m_buttons.getItem(item)->getBounds();