diff options
| author | Vincent Richard <[email protected]> | 2014-02-24 22:28:55 +0100 |
|---|---|---|
| committer | Vincent Richard <[email protected]> | 2014-02-24 22:28:55 +0100 |
| commit | 86eae80b686d5967962cd482f6db258a704992e2 (patch) | |
| tree | bc26411bdffa6f545237b8faf8322572640ce4a8 /src | |
| parent | Non exception-driven IMAP parser. (diff) | |
| parent | Merge pull request #70 from kisli/pr/69 (diff) | |
| download | vmime-86eae80b686d5967962cd482f6db258a704992e2.tar.gz vmime-86eae80b686d5967962cd482f6db258a704992e2.zip | |
Merge branch 'master' of https://github.com/kisli/vmime
Diffstat (limited to 'src')
| -rw-r--r-- | src/vmime/net/serviceFactory.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/vmime/net/serviceFactory.cpp b/src/vmime/net/serviceFactory.cpp index bbc9944a..b6f90eb2 100644 --- a/src/vmime/net/serviceFactory.cpp +++ b/src/vmime/net/serviceFactory.cpp @@ -60,7 +60,12 @@ shared_ptr <service> serviceFactory::create (shared_ptr <session> sess, const string& protocol, 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); } |
