From 077b4ca82a005190d849f5f54edf18e5661fbc1e Mon Sep 17 00:00:00 2001 From: Sander Rebry <71026399+kmoconnect@users.noreply.github.com> Date: Thu, 26 Sep 2024 09:01:06 +0200 Subject: [PATCH] Update PdfViewerEntry.php Fix: Allow getFileUrl to return null when no file is available - Updated the getFileUrl method to handle cases where a file URL might not exist. - Changed the return type to `string|null` for better flexibility and to prevent type errors when null is returned. --- src/Infolists/Components/PdfViewerEntry.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Infolists/Components/PdfViewerEntry.php b/src/Infolists/Components/PdfViewerEntry.php index c6f5cdb..2218b1d 100644 --- a/src/Infolists/Components/PdfViewerEntry.php +++ b/src/Infolists/Components/PdfViewerEntry.php @@ -53,7 +53,7 @@ public function fileUrl(string|Closure $fileUrl): self return $this; } - public function getFileUrl(?string $state = null): string + public function getFileUrl(?string $state = null): string|null { if (empty($state)) { return $this->evaluate($this->fileUrl);