ensure that factoryClass exisits before instantiation

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
Arthur Schiwon 2021-06-30 15:09:27 +02:00
parent 75f7287b5e
commit 12e4484dba
No known key found for this signature in database
GPG key ID: 7424F1874854DF23

View file

@ -1031,7 +1031,7 @@ class Server extends ServerContainer implements IServerContainer {
$this->registerService(ILDAPProviderFactory::class, function (ContainerInterface $c) {
$config = $c->get(\OCP\IConfig::class);
$factoryClass = $config->getSystemValue('ldapProviderFactory', null);
if (is_null($factoryClass)) {
if (is_null($factoryClass) || !class_exists($factoryClass)) {
return new NullLDAPProviderFactory($this);
}
/** @var \OCP\LDAP\ILDAPProviderFactory $factory */