From ee217ee3bd4fc6399a62f5e6f3870ebdd3a13337 Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Wed, 3 Jan 2024 12:20:42 -0500 Subject: [PATCH] Fix issue processwire/processwire-issues#1857 --- wire/modules/Inputfield/InputfieldFile/InputfieldFile.module | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wire/modules/Inputfield/InputfieldFile/InputfieldFile.module b/wire/modules/Inputfield/InputfieldFile/InputfieldFile.module index 080aeb70..6c62ac25 100644 --- a/wire/modules/Inputfield/InputfieldFile/InputfieldFile.module +++ b/wire/modules/Inputfield/InputfieldFile/InputfieldFile.module @@ -1224,7 +1224,7 @@ class InputfieldFile extends Inputfield implements InputfieldItemList, Inputfiel $pagefile = $this->processInputAddFile($filename); if($pagefile && isset($originalFilenames[$filename]) && $originalFilenames[$filename] != $filename) { $pagefile->filedata('uploadName', $originalFilenames[$filename]); - } else if($pagefile->filedata('uploadName')) { + } else if($pagefile && $pagefile->filedata('uploadName')) { $pagefile->filedata('uploadName', ''); // clear out previous } $changed = true;