From: Matthias Schmidt Date: Tue, 23 Dec 2014 08:07:31 +0000 (+0100) Subject: Add missing checks in FileOptionType X-Git-Tag: 2.1.0_Beta_3~96^2~3 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=42a28cbc4c10c822eef279dcdd3038cf34c1cb78;p=GitHub%2FWoltLab%2FWCF.git Add missing checks in FileOptionType --- diff --git a/wcfsetup/install/files/lib/system/option/FileOptionType.class.php b/wcfsetup/install/files/lib/system/option/FileOptionType.class.php index 53d190c75e..edb361e143 100644 --- a/wcfsetup/install/files/lib/system/option/FileOptionType.class.php +++ b/wcfsetup/install/files/lib/system/option/FileOptionType.class.php @@ -42,6 +42,9 @@ class FileOptionType extends AbstractOptionType { */ public function getData(Option $option, $newValue) { $this->createUploadHandler($option); + if ($this->uploadHandlers[$option->optionName] === null) { + return ''; + } $files = $this->uploadHandlers[$option->optionName]->getFiles(); $file = reset($files); @@ -91,6 +94,9 @@ class FileOptionType extends AbstractOptionType { */ public function validate(Option $option, $newValue) { $this->createUploadHandler($option); + if ($this->uploadHandlers[$option->optionName] === null) { + return; + } $files = $this->uploadHandlers[$option->optionName]->getFiles(); $file = reset($files);