diff --git a/pcbnew/dialogs/dialog_drc.cpp b/pcbnew/dialogs/dialog_drc.cpp index 295bc75359..e0297edcd1 100644 --- a/pcbnew/dialogs/dialog_drc.cpp +++ b/pcbnew/dialogs/dialog_drc.cpp @@ -190,10 +190,13 @@ void DIALOG_DRC::OnActivateDlg( wxActivateEvent& aEvent ) bool DIALOG_DRC::updateUI() { - double cur = std::clamp( (double) m_progress.load() / m_maxProgress, 0.0, 1.0 ); + if( m_maxProgress != 0 ) + { + double cur = std::clamp( (double) m_progress.load() / m_maxProgress, 0.0, 1.0 ); - int newValue = KiROUND( cur * 1000.0 ); - m_gauge->SetValue( newValue ); + int newValue = KiROUND( cur * 1000.0 ); + m_gauge->SetValue( newValue ); + } // There is significant overhead on at least Windows when updateUi is called constantly thousands of times // in the drc process and safeyieldfor is called each time.