diff --git a/administrator/components/com_actionlogs/src/Model/ActionlogModel.php b/administrator/components/com_actionlogs/src/Model/ActionlogModel.php index f11c3bf87c034..0c7c46c3029d7 100644 --- a/administrator/components/com_actionlogs/src/Model/ActionlogModel.php +++ b/administrator/components/com_actionlogs/src/Model/ActionlogModel.php @@ -55,7 +55,13 @@ public function addLog($messages, $messageLanguageKey, $context, $userId = 0) @trigger_error(\sprintf('User ID must be an integer in %s.', __METHOD__), E_USER_DEPRECATED); } - $user = $userId ? $this->getUserFactory()->loadUserById($userId) : $this->getCurrentUser(); + try { + $user = $userId ? $this->getUserFactory()->loadUserById($userId) : $this->getCurrentUser(); + } catch (\UnexpectedValueException $e) { + @trigger_error(\sprintf('UserFactory must be set, this will not be caught anymore in 7.0.'), E_USER_DEPRECATED); + $user = Factory::getUser($userId); + } + $db = $this->getDatabase(); $date = Factory::getDate(); $params = ComponentHelper::getComponent('com_actionlogs')->getParams();