diff --git a/lib/form/filemanager.php b/lib/form/filemanager.php index 26c2271e0d4..af191a0e8d6 100644 --- a/lib/form/filemanager.php +++ b/lib/form/filemanager.php @@ -320,11 +320,15 @@ class MoodleQuickForm_filemanager extends HTML_QuickForm_element implements temp /** * Check that all files have the allowed type. * - * @param array $value Draft item id with the uploaded files. + * @param int $value Draft item id with the uploaded files. * @return string|null Validation error message or null. */ public function validateSubmitValue($value) { + if (empty($value)) { + return; + } + $filetypesutil = new \core_form\filetypes_util(); $whitelist = $filetypesutil->normalize_file_types($this->_options['accepted_types']);