Browse Source

fix potential div by zero

pull/2741/head
Jason Dove 7 months ago
parent
commit
9999a7b394
No known key found for this signature in database
  1. 2
      ErsatzTV.Core/Scheduling/YamlScheduling/Handlers/YamlPlayoutCountHandler.cs

2
ErsatzTV.Core/Scheduling/YamlScheduling/Handlers/YamlPlayoutCountHandler.cs

@ -43,7 +43,7 @@ public class YamlPlayoutCountHandler(EnumeratorCache enumeratorCache) : YamlPlay @@ -43,7 +43,7 @@ public class YamlPlayoutCountHandler(EnumeratorCache enumeratorCache) : YamlPlay
e.Result = name switch
{
"count" => enumeratorCount,
"random" => random.Next() % enumeratorCount,
"random" => enumeratorCount > 0 ? random.Next() % enumeratorCount : 0,
_ => e.Result
};
};

Loading…
Cancel
Save