Handle nil slash.

This commit is contained in:
bootstraponline
2012-08-23 12:30:08 -06:00
parent 01fa4770cb
commit 33ca329253
+8 -1
View File
@@ -448,9 +448,16 @@ module Gollum
# is found. # is found.
def find_page_from_name(cname) def find_page_from_name(cname)
slash = cname.rindex('/') slash = cname.rindex('/')
unless slash.nil?
name = cname[slash+1..-1] name = cname[slash+1..-1]
path = cname[0..slash] path = cname[0..slash]
if page = @wiki.paged(name, path) page = @wiki.paged(name, path)
else
page = @wiki.page(cname)
end
if page
return page return page
end end
if pos = cname.index('#') if pos = cname.index('#')