Index: src/OFEmbeddedFileURLHandler.m ================================================================== --- src/OFEmbeddedFileURLHandler.m +++ src/OFEmbeddedFileURLHandler.m @@ -74,19 +74,20 @@ @implementation OFEmbeddedFileURLHandler - (OFStream *)openItemAtURL: (OFURL *)URL mode: (OFString *)mode { const char *path; + if (![URL.scheme isEqual: @"objfw-embedded"] || URL.host != nil || + URL.port != nil || URL.user != nil || URL.password != nil || + URL.query != nil || URL.fragment != nil) + @throw [OFInvalidArgumentException exception]; + if (![mode isEqual: @"r"]) @throw [OFOpenItemFailedException exceptionWithURL: URL mode: mode errNo: EROFS]; - if (URL.host != nil || URL.port != nil || URL.user != nil || - URL.password != nil || URL.query != nil || URL.fragment != nil) - @throw [OFInvalidArgumentException exception]; - if ((path = URL.path.UTF8String) == NULL) { @throw [OFInvalidArgumentException exception]; } #ifdef OF_HAVE_THREADS