mirror of
https://github.com/oliexdev/openScale.git
synced 2025-08-16 05:34:05 +02:00
fixed crash when disable and enable measurements with no data, see #653
This commit is contained in:
@@ -392,8 +392,12 @@ public class ChartMeasurementView extends LineChart {
|
|||||||
addTrendLine(lineDataSets);
|
addTrendLine(lineDataSets);
|
||||||
}
|
}
|
||||||
|
|
||||||
LineData data = new LineData(lineDataSets);
|
if (!lineDataSets.isEmpty()) {
|
||||||
setData(data);
|
LineData data = new LineData(lineDataSets);
|
||||||
|
setData(data);
|
||||||
|
} else {
|
||||||
|
setData(null);
|
||||||
|
}
|
||||||
|
|
||||||
if (prefs.getBoolean("goalLine", false)) {
|
if (prefs.getBoolean("goalLine", false)) {
|
||||||
addGoalLine(lineDataSets);
|
addGoalLine(lineDataSets);
|
||||||
@@ -424,7 +428,7 @@ public class ChartMeasurementView extends LineChart {
|
|||||||
measurementLine.enableDashedLine(0, 1, 0);
|
measurementLine.enableDashedLine(0, 1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (measurementView.isVisible()) {
|
if (measurementView.isVisible() && !lineEntries.isEmpty()) {
|
||||||
if (isInGraphKey) {
|
if (isInGraphKey) {
|
||||||
if (measurementView.getSettings().isInGraph()) {
|
if (measurementView.getSettings().isInGraph()) {
|
||||||
lineDataSets.add(measurementLine);
|
lineDataSets.add(measurementLine);
|
||||||
|
Reference in New Issue
Block a user