Selaa lähdekoodia

Fix divide by zero crash

nordsoft 2 vuotta sitten
vanhempi
sitoutus
d63e32841d
1 muutettua tiedostoa jossa 3 lisäystä ja 0 poistoa
  1. 3 0
      lib/LoadProgress.cpp

+ 3 - 0
lib/LoadProgress.cpp

@@ -23,6 +23,9 @@ Type Progress::get() const
 	if(_step >= _maxSteps)
 		return _target;
 	
+	if(!_maxSteps)
+		return _progress;
+	
 	return static_cast<int>(_progress) + _step * static_cast<int>(_target - _progress) / _maxSteps;
 }