Skip to content
Snippets Groups Projects
Commit c56171a6 authored by Viktor Holovachek's avatar Viktor Holovachek
Browse files

Issue #3332885 - Add validation by user

parent 4b026d78
Branches
Tags
1 merge request!10Issue #3332885 - Add validation by user
......@@ -233,7 +233,13 @@ class LogMessage {
*/
public function getUser(): UserInterface {
if (!isset($this->user)) {
$this->user = User::load($this->context['uid']);
if (isset($this->context['uid']) && $user = User::load($this->context['uid'])) {
/** @var \Drupal\user\UserInterface user */
$this->user = $user;
}
else {
$this->user = User::load(\Drupal::currentUser()->id());
}
}
return $this->user;
}
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment