From 9a8b13a1ccef6b71d3ae681f37ce6409014b6e77 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Sun, 28 Jun 2020 19:23:38 +0200 Subject: [PATCH] check if $recipients is set --- controllers/class.AddDocument.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/controllers/class.AddDocument.php b/controllers/class.AddDocument.php index 79a1dca76..6a0ad33ee 100644 --- a/controllers/class.AddDocument.php +++ b/controllers/class.AddDocument.php @@ -124,17 +124,19 @@ class SeedDMS_Controller_AddDocument extends SeedDMS_Controller_Common { } $lc = $document->getLatestContent(); - if($recipients['i']) { - foreach($recipients['i'] as $uid) { - if($u = $dms->getUser($uid)) { - $res = $lc->addIndRecipient($u, $user); + if($recipients) { + if($recipients['i']) { + foreach($recipients['i'] as $uid) { + if($u = $dms->getUser($uid)) { + $res = $lc->addIndRecipient($u, $user); + } } } - } - if($recipients['g']) { - foreach($recipients['g'] as $gid) { - if($g = $dms->getGroup($gid)) { - $res = $lc->addGrpRecipient($g, $user); + if($recipients['g']) { + foreach($recipients['g'] as $gid) { + if($g = $dms->getGroup($gid)) { + $res = $lc->addGrpRecipient($g, $user); + } } } }