     /// - Parameter response: the response
     ///
     func process(request: RouterRequest, response: RouterResponse, next: () -> Void) {
-        let urlPath = request.parsedUrl.path!
+        guard let urlPath = request.parsedUrl.path else {
+            Log.error("Failed to process request")
+            return
+        }
 
         if response.error == nil || method == .Error {
             if response.error != nil || method == .All || method == request.method {
                 // Either response error exists and method is error, or method matches
                 if  let regex = regex  {
-#if os(Linux)  
+#if os(Linux)
                     let tempMatch = regex.firstMatchInString(urlPath, options: [], range: NSMakeRange(0, urlPath.characters.count))
 #else
                     let tempMatch = regex.firstMatch(in: urlPath, options: [], range: NSMakeRange(0, urlPath.characters.count))
 #endif
                     if  let match = tempMatch  {
-#if os(Linux)  
+#if os(Linux)
                     request.matchedPath = urlPath.bridge().substringWithRange(match.range)
 #else
                     request.matchedPath = urlPath.bridge().substring(with: match.range)

                    request.route = pattern
                    request.params = [:]
                    processHelper(request, response: response, next: next)
                } 
            } else {
                next()
            }

            var keys: [String] = []
            var nonKeyIndex = 0

#if os(Linux)
            let paths = pattern.bridge().componentsSeparatedByString("/")
#else
            let paths = pattern.bridge().componentsSeparated(by: "/")
#endif
