Index: src/OFURLHandler.h ================================================================== --- src/OFURLHandler.h +++ src/OFURLHandler.h @@ -56,11 +56,11 @@ /** * @brief Returns the handler for the specified URL. * * @return The handler for the specified URL. */ -+ (nullable OF_KINDOF(OFURLHandler *))handlerForURL: (OFURL *)URL; ++ (OF_KINDOF(OFURLHandler *))handlerForURL: (OFURL *)URL; - (instancetype)init OF_UNAVAILABLE; /** * @brief Initializes the handler for the specified scheme. Index: src/OFURLHandler.m ================================================================== --- src/OFURLHandler.m +++ src/OFURLHandler.m @@ -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 {