diff --git a/CHANGELOG.md b/CHANGELOG.md index a86ec0268..6dc85046d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ * Fixed `.md` page to be assigned to the default language and to be listed in translated/untranslated page list * Fixed `Language::getFallbackPageExtensions()` to append `.md` file after the default language extension * Fixed `Language::getFallbackPageExtensions()` returning wrong file extensions when passing custom page extension + * Fixed error when calling `Media::add($name, null)` # v1.6.11 ## 06/21/2019 diff --git a/system/src/Grav/Common/Page/Medium/AbstractMedia.php b/system/src/Grav/Common/Page/Medium/AbstractMedia.php index 0ad4573d8..f67cd650e 100644 --- a/system/src/Grav/Common/Page/Medium/AbstractMedia.php +++ b/system/src/Grav/Common/Page/Medium/AbstractMedia.php @@ -154,6 +154,9 @@ abstract class AbstractMedia implements ExportInterface, MediaCollectionInterfac */ public function add($name, $file) { + if (!$file) { + return; + } $this->offsetSet($name, $file); switch ($file->type) { case 'image':