This commit is contained in:
Vincent Richard 2014-02-24 22:28:55 +01:00
commit 86eae80b68

View File

@ -60,7 +60,12 @@ shared_ptr <service> serviceFactory::create
(shared_ptr <session> sess, const string& protocol, (shared_ptr <session> sess, const string& protocol,
shared_ptr <security::authenticator> auth) shared_ptr <security::authenticator> auth)
{ {
return (getServiceByProtocol(protocol)->create(sess, auth)); shared_ptr <const registeredService> rserv = getServiceByProtocol(protocol);
if (!rserv)
throw exceptions::no_factory_available("No service is registered for protocol '" + protocol + "'.");
return rserv->create(sess, auth);
} }