Skip to content

Commit

Permalink
Fixed crash when unpacking NDS ROMs in ToolkitForm
Browse files Browse the repository at this point in the history
  • Loading branch information
evandixon committed Dec 6, 2016
1 parent d478ca0 commit 7c8d7a2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
6 changes: 5 additions & 1 deletion DotNet3dsToolkit/Misc/GenericNDSRom.vb
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,11 @@ Public Class GenericNDSRom
''' <returns></returns>
Public ReadOnly Property ExtractionProgress As Single Implements IReportProgress.Progress
Get
Return CurrentExtractProgress / CurrentExtractMax
If CurrentExtractMax = 0 Then
Return 0
Else
Return CurrentExtractProgress / CurrentExtractMax
End If
End Get
End Property

Expand Down
9 changes: 7 additions & 2 deletions ToolkitForm/Form1.vb
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,16 @@ Public Class Form1
End Sub

Private Sub OnUnpackProgressedInternal(sender As Object, e As ProgressReportedEventArgs)
If pbProgress.Style = ProgressBarStyle.Marquee Then
If e.IsIndeterminate OrElse e.Progress = Single.NaN Then
pbProgress.Style = ProgressBarStyle.Marquee
Else
pbProgress.Style = ProgressBarStyle.Continuous
End If

pbProgress.Value = e.Progress * pbProgress.Maximum
If Not SIngle.IsNaN(e.Progress) Then
pbProgress.Value = e.Progress * pbProgress.Maximum
End If

lblStatus.Text = String.Format("Extracting...")
End Sub

Expand Down

0 comments on commit 7c8d7a2

Please sign in to comment.