Only use the user session if ownCloud is already installed
When installing ownCloud with autotest and MySQL some log entries may be created which will invoke the logging class. IUserSession has a dependency on the database which will make the installation fail => 💣
This commit is contained in:
parent
460bafea8a
commit
1fffc30cf0
1 changed files with 5 additions and 1 deletions
|
@ -90,7 +90,11 @@ class OC_Log_Owncloud {
|
|||
$time = $time->format($format);
|
||||
$url = ($request->getRequestUri() !== '') ? $request->getRequestUri() : '--';
|
||||
$method = is_string($request->getMethod()) ? $request->getMethod() : '--';
|
||||
$userObj = \OC::$server->getUserSession()->getUser();
|
||||
if(\OC::$server->getConfig()->getSystemValue('installed', false)) {
|
||||
$userObj = \OC::$server->getUserSession()->getUser();
|
||||
} else {
|
||||
$userObj = null;
|
||||
}
|
||||
$user = !is_null($userObj) ? $userObj->getUID() : '--';
|
||||
$entry = compact(
|
||||
'reqId',
|
||||
|
|
Loading…
Reference in a new issue