From ee4162a5659dd4eb60e5613187b0ec04ef89c272 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 31 Oct 2023 18:51:03 +0100 Subject: [PATCH] check if $previewer is set --- views/bootstrap/class.Bootstrap.php | 4 ++-- views/bootstrap4/class.Bootstrap4.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/views/bootstrap/class.Bootstrap.php b/views/bootstrap/class.Bootstrap.php index 9e55e762d..f69ec0da9 100644 --- a/views/bootstrap/class.Bootstrap.php +++ b/views/bootstrap/class.Bootstrap.php @@ -3170,7 +3170,7 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev) if(!$skipcont) $content .= $this->documentListRowStart($document); - $previewer->createPreview($latestContent); + if($previewer) $previewer->createPreview($latestContent); $version = $latestContent->getVersion(); if($ec = $this->callHook('documentListRowExtraContent', $document, $latestContent)) @@ -3184,7 +3184,7 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev) else { if($accessop->check_controller_access('Download', array('action'=>'version'))) $content .= "params['settings']->_httpRoot."op/op.Download.php?documentid=".$docID."&version=".$version."\">"; - if($previewer->hasPreview($latestContent)) { + if($previewer && $previewer->hasPreview($latestContent)) { $content .= "params['settings']->_httpRoot."op/op.Preview.php?documentid=".$document->getID()."&version=".$latestContent->getVersion()."&width=".$previewwidth."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">"; } else { $content .= "getMimeIcon($latestContent->getFileType())."\" ".($previewwidth ? "width=\"".$previewwidth."\"" : "")."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">"; diff --git a/views/bootstrap4/class.Bootstrap4.php b/views/bootstrap4/class.Bootstrap4.php index f718265e4..01830c2e6 100644 --- a/views/bootstrap4/class.Bootstrap4.php +++ b/views/bootstrap4/class.Bootstrap4.php @@ -3244,7 +3244,7 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev) if(!$skipcont) $content .= $this->documentListRowStart($document); - $previewer->createPreview($latestContent); + if($previewer) $previewer->createPreview($latestContent); $version = $latestContent->getVersion(); if($ec = $this->callHook('documentListRowExtraContent', $document, $latestContent)) @@ -3258,7 +3258,7 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev) else { if($accessop->check_controller_access('Download', array('action'=>'version'))) $content .= "params['settings']->_httpRoot."op/op.Download.php?documentid=".$docID."&version=".$version."\">"; - if($previewer->hasPreview($latestContent)) { + if($previewer && $previewer->hasPreview($latestContent)) { $content .= "params['settings']->_httpRoot."op/op.Preview.php?documentid=".$document->getID()."&version=".$latestContent->getVersion()."&width=".$previewwidth."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">"; } else { $content .= "getMimeIcon($latestContent->getFileType())."\" ".($previewwidth ? "width=\"".$previewwidth."\"" : "")."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">";