diff --git a/Src/PChecker/CheckerCore/SystematicTesting/Strategies/Feedback/Generator/ControlledRandom.cs b/Src/PChecker/CheckerCore/SystematicTesting/Strategies/Feedback/Generator/ControlledRandom.cs
index d271a830b..8d9797854 100644
--- a/Src/PChecker/CheckerCore/SystematicTesting/Strategies/Feedback/Generator/ControlledRandom.cs
+++ b/Src/PChecker/CheckerCore/SystematicTesting/Strategies/Feedback/Generator/ControlledRandom.cs
@@ -45,7 +45,14 @@ public int Next()
///
public int Next(int maxValue)
{
- return IntChoices.Next() % maxValue;
+ if (maxValue == 0)
+ {
+ return 0;
+ }
+ else
+ {
+ return IntChoices.Next() % maxValue;
+ }
}
///