mirror of
https://github.com/huderlem/porymap.git
synced 2026-08-23 00:56:47 -05:00
Fix crash when changing theme of an empty chart
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user