mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
Fix new Cyclist SEGV on open options dialog
The code to set the critical power for the cyclist page in the config dialog calls zones->getCP(currentRange) when currentRange is -1 (out of bounds). This caused a SEGV. This patch checks for a -1 value and sets CP to 0 rather than calling zones->getCP.
This commit is contained in:
committed by
Sean Rhea
parent
a3ae0ee314
commit
78716c3f4b
@@ -226,7 +226,7 @@ CyclistPage::CyclistPage(const Zones *_zones):
|
||||
checkboxNew->setCheckState(Qt::Unchecked);
|
||||
}
|
||||
|
||||
int cp = zones->getCP(currentRange);
|
||||
int cp = currentRange != -1 ? zones->getCP(currentRange) : 0;
|
||||
if (cp > 0)
|
||||
setCP(cp);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user