Fix occasional divide by zero crash

This commit is contained in:
Jonathan White 2018-08-14 23:00:38 -04:00 committed by Jonathan White
parent 3b1e15ea1a
commit 8db604e787

View File

@ -51,7 +51,11 @@ UrlFetchProgressDialog::UrlFetchProgressDialog(const QUrl &url, QWidget *parent)
void UrlFetchProgressDialog::networkReplyProgress(qint64 bytesRead, qint64 totalBytes) void UrlFetchProgressDialog::networkReplyProgress(qint64 bytesRead, qint64 totalBytes)
{ {
if (totalBytes > 0) {
setValue(static_cast<int>(bytesRead / totalBytes)); setValue(static_cast<int>(bytesRead / totalBytes));
} else {
setValue(0);
}
} }
EditWidgetIcons::EditWidgetIcons(QWidget* parent) EditWidgetIcons::EditWidgetIcons(QWidget* parent)