diff options
-rw-r--r-- | app/Controller/ProjectPermission.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/Controller/ProjectPermission.php b/app/Controller/ProjectPermission.php index 800da02f..e203c0db 100644 --- a/app/Controller/ProjectPermission.php +++ b/app/Controller/ProjectPermission.php @@ -83,7 +83,9 @@ class ProjectPermission extends Base $project = $this->getProject(); $values = $this->request->getValues(); - if ($this->projectUserRole->addUser($values['project_id'], $values['user_id'], $values['role'])) { + if (empty($values['user_id'])) { + $this->flash->failure(t('User not found.')); + } elseif ($this->projectUserRole->addUser($values['project_id'], $values['user_id'], $values['role'])) { $this->flash->success(t('Project updated successfully.')); } else { $this->flash->failure(t('Unable to update this project.')); |