check if document != null

This commit is contained in:
Uwe Steinmann 2020-12-18 06:42:35 +01:00
parent 41584479b7
commit 02a0ef95f9

View File

@ -120,7 +120,7 @@ $(document).ready( function() {
if($resArr) {
foreach ($resArr as $res) {
$document = $dms->getDocument($res["id"]);
if($document->getAccessMode($user) >= M_READ && $document->getLatestContent()) {
if($document && $document->getAccessMode($user) >= M_READ && $document->getLatestContent()) {
$tasks['review'][] = array('id'=>$res['id'], 'name'=>$res['name']);
}
}
@ -132,7 +132,7 @@ $(document).ready( function() {
if($resArr) {
foreach ($resArr as $res) {
$document = $dms->getDocument($res["id"]);
if($document->getAccessMode($user) >= M_READ && $document->getLatestContent()) {
if($document && $document->getAccessMode($user) >= M_READ && $document->getLatestContent()) {
$tasks['approval'][] = array('id'=>$res['id'], 'name'=>$res['name']);
}
}