From 20bc412a17d6ff7655330a5aecb5af4d853de80c Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Thu, 14 Jan 2021 09:46:34 +0100 Subject: [PATCH] check if document exists --- views/bootstrap/class.MyDocuments.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/views/bootstrap/class.MyDocuments.php b/views/bootstrap/class.MyDocuments.php index f754a6acb..462f7dd15 100644 --- a/views/bootstrap/class.MyDocuments.php +++ b/views/bootstrap/class.MyDocuments.php @@ -91,13 +91,14 @@ $(document).ready( function() { $noaccess = 0; $docs = []; foreach ($resArr as $res) { - $document = $dms->getDocument($res["id"]); - $document->verifyLastestContentExpriry(); + if($document = $dms->getDocument($res["id"])) { + $document->verifyLastestContentExpriry(); - if($document->getAccessMode($user) >= M_READ && $document->getLatestContent()) { - $docs[] = $document; - } else { - $noaccess++; + if($document->getAccessMode($user) >= M_READ && $document->getLatestContent()) { + $docs[] = $document; + } else { + $noaccess++; + } } } if($this->hasHook('filterList'))