diff --git a/src/CpintPlot.h b/src/CpintPlot.h index 7ae61bf2a..8b36b809b 100644 --- a/src/CpintPlot.h +++ b/src/CpintPlot.h @@ -39,6 +39,7 @@ class RideItem; class Zones; class Context; class LTMCanvasPicker; +class CriticalPowerWindow; class penTooltip: public QwtPlotZoomer { @@ -135,6 +136,8 @@ class CpintPlot : public QwtPlot protected: + friend class ::CriticalPowerWindow; + QString path; QwtPlotCurve *thisCurve; QwtPlotCurve *CPCurve, *extendedCPCurve2, *extendedCPCurve4; diff --git a/src/CriticalPowerWindow.cpp b/src/CriticalPowerWindow.cpp index 78bfe0107..0dc9e0197 100644 --- a/src/CriticalPowerWindow.cpp +++ b/src/CriticalPowerWindow.cpp @@ -882,7 +882,7 @@ CriticalPowerWindow::updateCpint(double minutes) { QString label; int index = (int) ceil(minutes * 60); - if (index >= 0 && cpintPlot->getBests().count() > index) { + if (index >= 0 && cpintPlot->bests && cpintPlot->getBests().count() > index) { QDate date = cpintPlot->getBestDates()[index]; double value = cpintPlot->getBests()[index];