Explorar o código

Fix server error

Thibaut Courouble %!s(int64=9) %!d(string=hai) anos
pai
achega
a13ac78a8c
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      lib/app.rb

+ 1 - 1
lib/app.rb

@@ -301,7 +301,7 @@ class App < Sinatra::Application
   get %r{\A/([\w~\.%]+)(\-[\w\-]+)?(/.*)?\z} do |doc, type, rest|
     doc.sub! '%7E', '~'
     return redirect "/#{DOC_REDIRECTS[doc]}#{type}#{rest}", 301 if DOC_REDIRECTS.key?(doc)
-    return redirect "/angularjs/api#{rest}", 301 if doc == 'angular' && rest.start_with?('/ng')
+    return redirect "/angularjs/api#{rest}", 301 if doc == 'angular' && rest && rest.start_with?('/ng')
     return 404 unless @doc = find_doc(doc)
 
     if rest.nil?