Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/private/PreviewManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public function getPreview(
$mimeType = null,
bool $cacheResult = true,
): ISimpleFile {
$this->throwIfPreviewsDisabled();
$this->throwIfPreviewsDisabled($file);
$previewConcurrency = $this->getGenerator()->getNumConcurrentPreviews('preview_concurrency_all');
$sem = Generator::guardWithSemaphore(Generator::SEMAPHORE_ID_ALL, $previewConcurrency);
try {
Expand All @@ -178,7 +178,7 @@ public function getPreview(
* @since 19.0.0
*/
public function generatePreviews(File $file, array $specifications, $mimeType = null) {
$this->throwIfPreviewsDisabled();
$this->throwIfPreviewsDisabled($file);
return $this->getGenerator()->generatePreviews($file, $specifications, $mimeType);
}

Expand Down Expand Up @@ -455,8 +455,8 @@ private function registerBootstrapProviders(): void {
/**
* @throws NotFoundException if preview generation is disabled
*/
private function throwIfPreviewsDisabled(): void {
if (!$this->enablePreviews) {
private function throwIfPreviewsDisabled(File $file): void {
if (!$this->isAvailable($file)) {
throw new NotFoundException('Previews disabled');
}
}
Expand Down
Loading