From 9c928b0375c1aab0c46768101849ce8daeae9b81 Mon Sep 17 00:00:00 2001 From: Wolfgang Witt Date: Mon, 1 Mar 2021 19:39:34 +0100 Subject: [PATCH] fix: make sure to report NoUsers, regardless of rule --- src/Handler/Utils/Exam.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Handler/Utils/Exam.hs b/src/Handler/Utils/Exam.hs index 03296e157..ce751ecaf 100644 --- a/src/Handler/Utils/Exam.hs +++ b/src/Handler/Utils/Exam.hs @@ -347,7 +347,8 @@ examAutoOccurrence (hash -> seed) rule ExamAutoOccurrenceConfig{..} occurrences ] takeEnd n chars = drop (length chars - n) chars in Map.mapKeysWith Set.union (takeEnd . F.minimum . Set.map length $ Map.keysSet matrUsers) matrUsers - _ -> Map.singleton [] $ Map.keysSet users + _ | null users-> Map.empty + | otherwise -> Map.singleton [] $ Map.keysSet users occurrences' :: Map ExamOccurrenceId Natural -- ^ reduce room capacity for every pre-assigned user by 1