@@ -29,10 +29,12 @@ # import "OFFileURLHandler.h" #endif #if defined(OF_HAVE_SOCKETS) && defined(OF_HAVE_THREADS) # import "OFHTTPURLHandler.h" #endif + +#import "OFUnsupportedProtocolException.h" static OFMutableDictionary OF_GENERIC(OFString *, OFURLHandler *) *handlers; #ifdef OF_HAVE_THREADS static OFMutex *mutex; @@ -107,10 +109,13 @@ } @finally { [mutex unlock]; } #endif + if (handler == nil) + @throw [OFUnsupportedProtocolException exceptionWithURL: URL]; + return handler; } - (instancetype)init {