diff --git a/lib/classes/coursewizardsteps/LVGroupsWizardStep.php b/lib/classes/coursewizardsteps/LVGroupsWizardStep.php
index abe00b6baa609f412bc470fc92fbb46f9075353c..380f33db2546a13b28e1a52fbffca02b09520027 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.');
             }