Fix uncaught exception

This commit is contained in:
Markus Gans 2020-02-02 23:57:18 +01:00
parent 60009d8f4b
commit 057c295af6
2 changed files with 13 additions and 1 deletions

View File

@ -1839,8 +1839,17 @@ inline FString FListView::getCheckBox (const FListViewItem* item)
checkbox.setString("[ ] "); checkbox.setString("[ ] ");
if ( item->isChecked() ) if ( item->isChecked() )
{
try
{
checkbox[1] = fc::Times; // Times × checkbox[1] = fc::Times; // Times ×
} }
catch (const std::out_of_range&)
{
return checkbox;
}
}
}
return checkbox; return checkbox;
} }

View File

@ -281,6 +281,9 @@ void FOptiAttrTest::sgrOptimizerTest()
std::strcpy(buffer, CSI "m" CSI "38;2;0;139;139m" CSI "48;2;240;255;240m"); std::strcpy(buffer, CSI "m" CSI "38;2;0;139;139m" CSI "48;2;240;255;240m");
sgr_optimizer.optimize(); sgr_optimizer.optimize();
CPPUNIT_ASSERT_CSTRING ( buffer, C_STR(CSI "0;38;2;0;139;139;48;2;240;255;240m") ); CPPUNIT_ASSERT_CSTRING ( buffer, C_STR(CSI "0;38;2;0;139;139;48;2;240;255;240m") );
delete to;
delete from;
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------