diff --git a/Classes/Common/AbstractDocument.php b/Classes/Common/AbstractDocument.php index 9620c4799..0f3d280f6 100644 --- a/Classes/Common/AbstractDocument.php +++ b/Classes/Common/AbstractDocument.php @@ -574,7 +574,7 @@ public static function &getInstance(string $location, array $settings = [], bool } // Sanitize input. - $pid = max((int) $settings['storagePid'], 0); + $pid = $settings['storagePid'] ? max((int) $settings['storagePid'], 0) : 0; if ($documentFormat == 'METS') { $instance = new MetsDocument($pid, $location, $xml, $settings); } elseif ($documentFormat == 'IIIF') {