diff --git a/lib/classes/coursewizardsteps/LVGroupsWizardStep.php b/lib/classes/coursewizardsteps/LVGroupsWizardStep.php
index 58e792e39b483b13cd88ce8e7396cefb30b012a3..07c304ec148f509f7a9d6212e1f07cc110a1279b 100644
--- a/lib/classes/coursewizardsteps/LVGroupsWizardStep.php
+++ b/lib/classes/coursewizardsteps/LVGroupsWizardStep.php
@@ -407,7 +407,11 @@ class LVGroupsWizardStep implements CourseWizardStep
             }
         } else {
             // optional step if study areas step is activated and at least one area is assigned
-            if (!count($values[__CLASS__]['lvgruppe_selection']['areas'])) {
+            if (
+                !isset($values[__CLASS__]['lvgruppe_selection']['areas'])
+                || !is_array($values[__CLASS__]['lvgruppe_selection']['areas'])
+                || count($values[__CLASS__]['lvgruppe_selection']['areas']) === 0
+            ) {
                 $ok = false;
                 $errors[] = _('Der Veranstaltung muss mindestens eine Lehrveranstaltungsgruppe zugeordnet sein.');
             }