Commit a65de46f authored by Don Gagne's avatar Don Gagne

Fix crash when empty

parent d2832333
......@@ -38,10 +38,12 @@ FactValueSliderListModel::~FactValueSliderListModel()
int FactValueSliderListModel::resetInitialValue(void)
{
// Remove any old rows
beginRemoveRows(QModelIndex(), 0, _cValues - 1);
_cValues = 0;
endRemoveRows();
if (_cValues > 0) {
// Remove any old rows
beginRemoveRows(QModelIndex(), 0, _cValues - 1);
_cValues = 0;
endRemoveRows();
}
_initialValue = _fact.cookedValue().toDouble();
_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