fix: check if number of relevant user is >0 to prevent crash

This commit is contained in:
Wolfgang Witt 2021-02-06 15:42:24 +01:00 committed by Wolfgang Witt
parent 4dccd2830b
commit 317b95be31

View File

@ -269,7 +269,7 @@ examAutoOccurrence :: forall seed.
examAutoOccurrence (hash -> seed) rule ExamAutoOccurrenceConfig{..} occurrences users examAutoOccurrence (hash -> seed) rule ExamAutoOccurrenceConfig{..} occurrences users
| sum occurrences' < usersCount | sum occurrences' < usersCount
|| sum occurrences' <= 0 || sum occurrences' <= 0
|| Map.null users || Map.null users'
= nullResult = nullResult
| otherwise | otherwise
= case rule of = case rule of