/** @var \wcf\system\file\upload\UploadFile $file */
$file = $this->parameters['uploads']['favicon'];
- if ($file !== null) {
+ if ($file !== null && !$file->isProcessed()) {
$fileLocation = $file->getLocation();
if (($imageData = getimagesize($fileLocation)) === false) {
throw new \InvalidArgumentException('The given favicon is not an image');
$file->setProcessed($newLocation);
$hasFavicon = true;
}
- else {
+ else if ($file === null) {
foreach ($images as $filename => $length) {
unlink($style->getAssetPath().$filename);
}