From 85e2908b297fbf6fe4efdc3d7d472fb5fe484afa Mon Sep 17 00:00:00 2001 From: Beatrycze Volk Date: Thu, 30 May 2024 15:18:35 +0200 Subject: [PATCH] [BUGFIX] Return null in case when there is no file info for id (#1229) Co-authored-by: Sebastian Meyer --- Classes/Common/IiifManifest.php | 2 +- Classes/Common/MetsDocument.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Classes/Common/IiifManifest.php b/Classes/Common/IiifManifest.php index c44f985ed..073bf5a53 100644 --- a/Classes/Common/IiifManifest.php +++ b/Classes/Common/IiifManifest.php @@ -366,7 +366,7 @@ public function getFileInfo($id): ?array $this->fileInfos[$id]['mimeType'] = $this->getFileMimeType($id); } - return $this->fileInfos[$id]; + return $this->fileInfos[$id] ?? null; } /** diff --git a/Classes/Common/MetsDocument.php b/Classes/Common/MetsDocument.php index 8c450a3f3..a26b4e837 100644 --- a/Classes/Common/MetsDocument.php +++ b/Classes/Common/MetsDocument.php @@ -221,7 +221,7 @@ public function getFileInfo($id): ?array $this->fileInfos[$id]['mimeType'] = $this->getFileMimeType($id); } - return $this->fileInfos[$id]; + return $this->fileInfos[$id] ?? null; } /**