Commit a65de46f authored by Don Gagne's avatar Don Gagne

Fix crash when empty

parent d2832333
...@@ -38,10 +38,12 @@ FactValueSliderListModel::~FactValueSliderListModel() ...@@ -38,10 +38,12 @@ FactValueSliderListModel::~FactValueSliderListModel()
int FactValueSliderListModel::resetInitialValue(void) int FactValueSliderListModel::resetInitialValue(void)
{ {
// Remove any old rows if (_cValues > 0) {
beginRemoveRows(QModelIndex(), 0, _cValues - 1); // Remove any old rows
_cValues = 0; beginRemoveRows(QModelIndex(), 0, _cValues - 1);
endRemoveRows(); _cValues = 0;
endRemoveRows();
}
_initialValue = _fact.cookedValue().toDouble(); _initialValue = _fact.cookedValue().toDouble();
_initialValueRounded = qRound(_initialValue); _initialValueRounded = qRound(_initialValue);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment