From 42a28cbc4c10c822eef279dcdd3038cf34c1cb78 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Tue, 23 Dec 2014 09:07:31 +0100 Subject: [PATCH] Add missing checks in FileOptionType --- .../files/lib/system/option/FileOptionType.class.php | 6 ++++++ 1 file changed, 6 insertions(+) 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); -- 2.20.1