mirror of
https://github.com/huderlem/porymap.git
synced 2026-04-24 23:07:52 -05:00
Fix crash when changing theme of an empty chart
This commit is contained in:
parent
559f2ae6da
commit
5890324c96
|
|
@ -392,7 +392,7 @@ void WildMonChart::updateTheme() {
|
|||
// distribution chart determine what those mapping are (it always includes every
|
||||
// species in the table) and then we apply those mappings to subsequent charts.
|
||||
QChart *chart = ui->chartView_SpeciesDistribution->chart();
|
||||
if (!chart)
|
||||
if (!chart || chart->series().isEmpty())
|
||||
return;
|
||||
chart->setTheme(theme);
|
||||
saveSpeciesColors(static_cast<QAbstractBarSeries*>(chart->series().at(0))->barSets());
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user