Skip to content

Commit

Permalink
Fix divide by zero exception.
Browse files Browse the repository at this point in the history
  • Loading branch information
aoli-al committed Dec 5, 2024
1 parent 65042fe commit 7c17680
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 7c17680

Please sign in to comment.