Skip to content

Commit

Permalink
Fix divide by zero exception. (#808)
Browse files Browse the repository at this point in the history
  • Loading branch information
aoli-al authored Dec 10, 2024
1 parent 65042fe commit 545dec4
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,14 @@ public int Next()
/// <inheritdoc/>
public int Next(int maxValue)
{
return IntChoices.Next() % maxValue;
if (maxValue == 0)
{
return 0;
}
else
{
return IntChoices.Next() % maxValue;
}
}

/// <inheritdoc/>
Expand Down

0 comments on commit 545dec4

Please sign in to comment.